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