From 9cefbae7da02f35fe9d1417dc4475ef68c1285ae Mon Sep 17 00:00:00 2001 From: Alex Theimer Date: Wed, 31 Jan 2024 21:26:52 -0800 Subject: [PATCH] skrp fix --- .../filodb.coordinator/queryplanner/ShardKeyRegexPlanner.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coordinator/src/main/scala/filodb.coordinator/queryplanner/ShardKeyRegexPlanner.scala b/coordinator/src/main/scala/filodb.coordinator/queryplanner/ShardKeyRegexPlanner.scala index e92c576fa2..e3c5cad90b 100644 --- a/coordinator/src/main/scala/filodb.coordinator/queryplanner/ShardKeyRegexPlanner.scala +++ b/coordinator/src/main/scala/filodb.coordinator/queryplanner/ShardKeyRegexPlanner.scala @@ -232,7 +232,8 @@ class ShardKeyRegexPlanner(val dataset: Dataset, // Map column -> index, then use this to sort each shard key. // NOTE: this means the order in which shard-key columns are defined will affect query results. // Columns with higher cardinalities should be defined last. - val nonMetricShardKeyColToIndex = dataset.options.nonMetricShardColumns.zipWithIndex.toMap + val shardKeyCols = dataset.options.shardKeyColumns.filterNot(_ == dataset.options.metricColumn) + val nonMetricShardKeyColToIndex = shardKeyCols.zipWithIndex.toMap val partitionToKeyGroups = partitionsToNonSplitKeys.map{ case (partition, keys) => val prefixGroups = keys .map(key => key.sortBy(filter => nonMetricShardKeyColToIndex.get(filter.column)))