You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "gianm (via GitHub)" <gi...@apache.org> on 2023/03/07 07:27:23 UTC

[GitHub] [druid] gianm commented on a diff in pull request #13506: Sort-merge join and hash shuffles for MSQ.

gianm commented on code in PR #13506:
URL: https://github.com/apache/druid/pull/13506#discussion_r1127455895


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/kernel/GlobalSortMaxCountShuffleSpec.java:
##########
@@ -93,15 +110,26 @@ public Either<Long, ClusterByPartitions> generatePartitions(
 
   @Override
   @JsonProperty
-  public ClusterBy getClusterBy()
+  public ClusterBy clusterBy()
   {
     return clusterBy;
   }
 
-  @JsonProperty
-  int getPartitions()
+  @Override
+  public int partitionCount()
+  {
+    if (maxPartitions == 1) {
+      return maxPartitions;
+    } else {
+      // Number of actual partitions may be less than maxPartitions.
+      throw new IllegalStateException("Number of partitions not known.");
+    }
+  }

Review Comment:
   Ah, this method is never actually called, because we never need to know the partition count ahead of time for global-sort shuffle specs. This is a relic of a past version of the patch where global-sort with maxPartitions = 1 was a way of encoding "mix everything into a single partition". Now, there's an explicit "mix" spec, so this isn't needed any longer.
   
   I replaced the entire thing with a `throw`.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org