diff --git a/query/src/main/scala/filodb/query/LogicalPlan.scala b/query/src/main/scala/filodb/query/LogicalPlan.scala index 40f8961c0..cb33cc11e 100644 --- a/query/src/main/scala/filodb/query/LogicalPlan.scala +++ b/query/src/main/scala/filodb/query/LogicalPlan.scala @@ -2,7 +2,6 @@ package filodb.query import filodb.core.query.{ColumnFilter, RangeParams, RvRange} import filodb.core.query.Filter.Equals -import filodb.query.exec.TsCardExec //scalastyle:off number.of.types //scalastyle:off file.size.limit @@ -185,7 +184,8 @@ object TsCardinalities { case class TsCardinalities(shardKeyPrefix: Seq[String], numGroupByFields: Int, version: Int = 1, - datasets: Seq[String] = Seq()) extends LogicalPlan { + datasets: Seq[String] = Seq(), + userDatasets: String = "") extends LogicalPlan { import TsCardinalities._ require(numGroupByFields >= 1 && numGroupByFields <= 3, @@ -212,7 +212,7 @@ case class TsCardinalities(shardKeyPrefix: Seq[String], .mkString(",") + "}"), "numGroupByFields" -> numGroupByFields.toString, "verbose" -> "true", // Using this plan to determine if we need to pass additional values in groupKey or not - "datasets" -> datasets.mkString(TsCardExec.PREFIX_DELIM) + "datasets" -> userDatasets ) } } diff --git a/query/src/test/scala/filodb/query/LogicalPlanSpec.scala b/query/src/test/scala/filodb/query/LogicalPlanSpec.scala index e44fd6fa9..67decf515 100644 --- a/query/src/test/scala/filodb/query/LogicalPlanSpec.scala +++ b/query/src/test/scala/filodb/query/LogicalPlanSpec.scala @@ -327,11 +327,12 @@ class LogicalPlanSpec extends AnyFunSpec with Matchers { it ("TsCardinalities queryParams should have expected values") { val datasets = Seq("longtime-prometheus", "recordingrules-prometheus_rules_longterm") - val plan = TsCardinalities(Seq("a","b","c"), 3, 2, datasets) + val userDatasets = "\"raw\",\"recordingrules\"" + val plan = TsCardinalities(Seq("a","b","c"), 3, 2, datasets, userDatasets) val queryParamsMap = plan.queryParams() queryParamsMap.get("numGroupByFields").get shouldEqual "3" - queryParamsMap.get("datasets").get shouldEqual datasets.mkString(",") + queryParamsMap.get("datasets").get shouldEqual userDatasets queryParamsMap.get("verbose").get shouldEqual "true" queryParamsMap.get("match[]").get shouldEqual "{_ws_=\"a\",_ns_=\"b\",__name__=\"c\"}" }