adarshsanjeev commented on code in PR #16175:
URL: https://github.com/apache/druid/pull/16175#discussion_r1553103594
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:
##########
@@ -2036,19 +2045,24 @@ private static boolean isTimeBucketedIngestion(final
MSQSpec querySpec)
* Compute shard columns for {@link DimensionRangeShardSpec}. Returns an
empty list if range-based sharding
* is not applicable.
*/
- private static List<String> computeShardColumns(
+ private static Pair<List<String>, String> computeShardColumns(
final RowSignature signature,
final ClusterBy clusterBy,
- final ColumnMappings columnMappings
+ final ColumnMappings columnMappings,
+ boolean mayHaveMultiValuedClusterByFields
)
{
+ if (mayHaveMultiValuedClusterByFields) {
+ // DimensionRangeShardSpec cannot handle multi-valued fields.
+ return Pair.of(Collections.emptyList(), "Cannot use RangeShardSpec, the
fields in the CLUSTER BY clause contains a multivalues. Using NumberedShardSpec
instead.");
+ }
final List<KeyColumn> clusterByColumns = clusterBy.getColumns();
final List<String> shardColumns = new ArrayList<>();
final boolean boosted = isClusterByBoosted(clusterBy);
final int numShardColumns = clusterByColumns.size() -
clusterBy.getBucketByCount() - (boosted ? 1 : 0);
if (numShardColumns == 0) {
- return Collections.emptyList();
+ return Pair.of(Collections.emptyList(), "Cannot use RangeShardSpec, as
there are no shardColumns. Using NumberedShardSpec instead.");
Review Comment:
Changed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]