You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "Jackie-Jiang (via GitHub)" <gi...@apache.org> on 2023/11/01 01:53:07 UTC

Re: [PR] Refactor PlanFragmenter to make the logic more clear [pinot]

Jackie-Jiang commented on code in PR #11912:
URL: https://github.com/apache/pinot/pull/11912#discussion_r1378317237


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/logical/PlanFragmenter.java:
##########
@@ -126,49 +124,65 @@ public PlanNode visitExchange(ExchangeNode node, Context context) {
     if (!isPlanFragmentSplitter(node)) {
       return process(node, context);
     }
-    int currentPlanFragmentId = context._previousPlanFragmentId;
-    int nextPlanFragmentId = ++context._currentPlanFragmentId;
-    // Set previous PlanFragment ID in the context to be the next PlanFragment ID to be used by the child node.
-    context._previousPlanFragmentId = nextPlanFragmentId;
-    PlanNode nextPlanFragmentRoot = node.getInputs().get(0).visit(this, context);
 
+    // Split the ExchangeNode to a MailboxReceiveNode and a MailboxSendNode, where MailboxReceiveNode is the leave node
+    // of the current PlanFragment, and MailboxSendNode is the root node of the next PlanFragment.
+    int receiverPlanFragmentId = context._currentPlanFragmentId;
+    int senderPlanFragmentId = context._nextPlanFragmentId.getAndIncrement();

Review Comment:
   Good point, refactored again



-- 
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@pinot.apache.org

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


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