cryptoe commented on code in PR #14678:
URL: https://github.com/apache/druid/pull/14678#discussion_r1277110448


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/kernel/StageDefinition.java:
##########
@@ -130,10 +129,6 @@ public class StageDefinition
     this.shuffleCheckHasMultipleValues = shuffleCheckHasMultipleValues;
     this.frameReader = Suppliers.memoize(() -> 
FrameReader.create(signature))::get;
 
-    if (mustGatherResultKeyStatistics() && 
shuffleSpec.clusterBy().getColumns().isEmpty()) {

Review Comment:
   ```
   if (intermediateClusterBy.getColumns().isEmpty() && 
resultClusterBy.isEmpty()) {
         // Ignore shuffleSpecFactory, since we know only a single partition 
will come out, and we can save some effort.
         shuffleSpecFactoryPreAggregation = 
ShuffleSpecFactories.singlePartition();
         shuffleSpecFactoryPostAggregation = 
ShuffleSpecFactories.singlePartition();
       } else if (doOrderBy) {
         if( intermediateClusterBy.getColumns().isEmpty()){
           
shuffleSpecFactoryPreAggregation=ShuffleSpecFactories.singlePartition();
         }else {
           shuffleSpecFactoryPreAggregation = 
ShuffleSpecFactories.globalSortWithMaxPartitionCount(maxWorkerCount);
         }
         shuffleSpecFactoryPostAggregation = doLimitOrOffset
                                             ? 
ShuffleSpecFactories.singlePartition()
                                             : resultShuffleSpecFactory;
       } else {
       
       
       
   ```
   
   I think we should do this instead of removing this check. 
   There is no shuffling required in the `GroupByPreShuffleStage`    



-- 
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]

Reply via email to