Jackie-Jiang commented on code in PR #14797:
URL: https://github.com/apache/pinot/pull/14797#discussion_r1915907959
##########
pinot-query-planner/src/main/java/org/apache/pinot/query/routing/WorkerManager.java:
##########
@@ -121,13 +124,21 @@ private void assignWorkersToNonRootFragment(PlanFragment
fragment, DispatchableP
}
}
- private boolean isLocalExchange(List<PlanFragment> children) {
- if (children.size() != 1) {
- return false;
+ /**
+ * Returns the index of the child fragment that has a local exchange
(SINGLETON distribution), or {@code null} if none
+ * exists.
+ */
+ @Nullable
+ private Integer findLocalExchange(List<PlanFragment> children) {
+ int numChildren = children.size();
+ for (int i = 0; i < numChildren; i++) {
+ PlanNode childPlanNode = children.get(i).getFragmentRoot();
+ if (childPlanNode instanceof MailboxSendNode
+ && ((MailboxSendNode) childPlanNode).getDistributionType() ==
RelDistribution.Type.SINGLETON) {
+ return i;
+ }
}
- PlanNode childPlanNode = children.get(0).getFragmentRoot();
- return childPlanNode instanceof MailboxSendNode
- && ((MailboxSendNode) childPlanNode).getDistributionType() ==
RelDistribution.Type.SINGLETON;
Review Comment:
Sure
--
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]