Skip to content

Commit

Permalink
skrp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alextheimer committed Feb 1, 2024
1 parent 4d35d4e commit 9cefbae
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 9cefbae

Please sign in to comment.