From 041050e952508bea17aeb02ead42fc11ce142adf Mon Sep 17 00:00:00 2001 From: Yu Zhang Date: Wed, 8 Nov 2023 16:46:04 -0800 Subject: [PATCH] fix the message. --- .../queryplanner/LongTimeRangePlanner.scala | 4 ++-- .../queryplanner/PlannerHierarchySpec.scala | 10 +++++----- .../src/main/scala/filodb.core/query/RangeVector.scala | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/coordinator/src/main/scala/filodb.coordinator/queryplanner/LongTimeRangePlanner.scala b/coordinator/src/main/scala/filodb.coordinator/queryplanner/LongTimeRangePlanner.scala index 4f7084e6f9..ef52127d6f 100644 --- a/coordinator/src/main/scala/filodb.coordinator/queryplanner/LongTimeRangePlanner.scala +++ b/coordinator/src/main/scala/filodb.coordinator/queryplanner/LongTimeRangePlanner.scala @@ -70,8 +70,8 @@ import filodb.query.exec._ } else { atModifierTimestampsWithOffset.isEmpty } - require(isAtModifierValid, s"@modifier $atModifierTimestampsWithOffset is not supported because it queries data" + - s" from both downsample and raw cluster. Please adjust the start and end time if you want to use @modifier.") + require(isAtModifierValid, s"@modifier $atModifierTimestampsWithOffset is not supported. Because it queries" + + s"both down sampled and raw data. Please adjust the query parameters if you want to use @modifier.") if (maxOffset != minOffset && startWithOffsetMs - lookbackMs < earliestRawTime diff --git a/coordinator/src/test/scala/filodb.coordinator/queryplanner/PlannerHierarchySpec.scala b/coordinator/src/test/scala/filodb.coordinator/queryplanner/PlannerHierarchySpec.scala index 3c38005a58..77ffe62303 100644 --- a/coordinator/src/test/scala/filodb.coordinator/queryplanner/PlannerHierarchySpec.scala +++ b/coordinator/src/test/scala/filodb.coordinator/queryplanner/PlannerHierarchySpec.scala @@ -1895,7 +1895,7 @@ class PlannerHierarchySpec extends AnyFunSpec with Matchers with PlanValidationS val thrown = the[IllegalArgumentException] thrownBy rootPlanner.materialize(lp, QueryContext(origQueryParams = queryParams)) thrown.toString - .contains("both downsample and raw cluster. Please adjust the start and end time if you want to use @modifier") shouldEqual true + .contains("both down sampled and raw data. Please adjust the query parameters if you want to use @modifier") shouldEqual true } it("should thrown IllegalArgumentException because topk needs both raw and downsample cluster with @modifier") { @@ -1905,7 +1905,7 @@ class PlannerHierarchySpec extends AnyFunSpec with Matchers with PlanValidationS val thrown = the[IllegalArgumentException] thrownBy rootPlanner.materialize(lp, QueryContext(origQueryParams = queryParams)) thrown.toString - .contains("both downsample and raw cluster. Please adjust the start and end time if you want to use @modifier") shouldEqual true + .contains("both down sampled and raw data. Please adjust the query parameters if you want to use @modifier") shouldEqual true } it("should thrown IllegalArgumentException because @modifier and offset reads from downsample cluster, and the query range reads from raw cluster") { @@ -1916,7 +1916,7 @@ class PlannerHierarchySpec extends AnyFunSpec with Matchers with PlanValidationS val thrown = the[IllegalArgumentException] thrownBy rootPlanner.materialize(lp, QueryContext(origQueryParams = queryParams)) thrown.toString - .contains("both downsample and raw cluster. Please adjust the start and end time if you want to use @modifier") shouldEqual true + .contains("both down sampled and raw data. Please adjust the query parameters if you want to use @modifier") shouldEqual true } it("should thrown IllegalArgumentException because while @modifier needs data from downsample cluster, the plan is dispatched to raw cluster") { @@ -1926,7 +1926,7 @@ class PlannerHierarchySpec extends AnyFunSpec with Matchers with PlanValidationS val thrown = the[IllegalArgumentException] thrownBy rootPlanner.materialize(lp, QueryContext(origQueryParams = queryParams)) thrown.toString - .contains("both downsample and raw cluster. Please adjust the start and end time if you want to use @modifier") shouldEqual true + .contains("both down sampled and raw data. Please adjust the query parameters if you want to use @modifier") shouldEqual true } it("should thrown IllegalArgumentException because while @modifier needs data from raw cluster, the plan is dispatched to downsample cluster") { @@ -1936,7 +1936,7 @@ class PlannerHierarchySpec extends AnyFunSpec with Matchers with PlanValidationS val thrown = the[IllegalArgumentException] thrownBy rootPlanner.materialize(lp, QueryContext(origQueryParams = queryParams)) thrown.toString - .contains("both downsample and raw cluster. Please adjust the start and end time if you want to use @modifier") shouldEqual true + .contains("both down sampled and raw data. Please adjust the query parameters if you want to use @modifier") shouldEqual true } it("both modifier and query range require the data from downsample cluster.") { diff --git a/core/src/main/scala/filodb.core/query/RangeVector.scala b/core/src/main/scala/filodb.core/query/RangeVector.scala index d9c4d18ea1..98e24dcb6c 100644 --- a/core/src/main/scala/filodb.core/query/RangeVector.scala +++ b/core/src/main/scala/filodb.core/query/RangeVector.scala @@ -227,7 +227,7 @@ final class RepeatValueVector(rangeVectorKey: RangeVectorKey, override def rows(): RangeVectorCursor = { import NoCloseCursor._ // If rowReader is empty, iterate nothing. - val it = Iterator.from(0, rowReader.map(_ => stepMs.toInt).getOrElse(0)) + val it = Iterator.from(0, rowReader.map(_ => stepMs.toInt).getOrElse(1)) .takeWhile(_ <= endMs - startMs).map { i => val rr = rowReader.get val t = i + startMs