walterddr commented on code in PR #8558:
URL: https://github.com/apache/pinot/pull/8558#discussion_r855385322


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/StagePlanner.java:
##########
@@ -95,12 +97,15 @@ private StageNode walkRelPlan(RelNode node, int 
currentStageId) {
     if (isExchangeNode(node)) {
       // 1. exchangeNode always have only one input, get its input converted 
as a new stage root.
       StageNode nextStageRoot = walkRelPlan(node.getInput(0), getNewStageId());
-      RelDistribution.Type exchangeType = ((LogicalExchange) 
node).distribution.getType();
+      RelDistribution distribution = ((LogicalExchange) 
node).getDistribution();
+      RelDistribution.Type exchangeType = distribution.getType();
 
       // 2. make an exchange sender and receiver node pair
-      StageNode mailboxReceiver = new MailboxReceiveNode(currentStageId, 
nextStageRoot.getStageId(), exchangeType);
-      StageNode mailboxSender = new 
MailboxSendNode(nextStageRoot.getStageId(), mailboxReceiver.getStageId(),
+      StageNode mailboxReceiver = new MailboxReceiveNode(currentStageId, 
node.getRowType(), nextStageRoot.getStageId(),
           exchangeType);
+      StageNode mailboxSender = new 
MailboxSendNode(nextStageRoot.getStageId(), node.getRowType(),
+          mailboxReceiver.getStageId(), exchangeType, exchangeType == 
RelDistribution.Type.HASH_DISTRIBUTED
+          ? new FieldSelectionKeySelector(distribution.getKeys().get(0)) : 
null);

Review Comment:
   yes. ideally, we should take `SqlHints` to decide whether we want to use 
broadcast or distributed hash sender. i can default enable the broadcast or 
hash. and keep the other method conditional
   



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

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


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

Reply via email to