siddharthteotia commented on code in PR #9100:
URL: https://github.com/apache/pinot/pull/9100#discussion_r937204103
##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/logical/StagePlanner.java:
##########
@@ -105,30 +113,128 @@ private StageNode walkRelPlan(RelNode node, int
currentStageId) {
RelDistribution.Type exchangeType = distribution.getType();
// 2. make an exchange sender and receiver node pair
- StageNode mailboxReceiver = new MailboxReceiveNode(currentStageId,
nextStageRoot.getDataSchema(),
- nextStageRoot.getStageId(), exchangeType);
- StageNode mailboxSender = new
MailboxSendNode(nextStageRoot.getStageId(), nextStageRoot.getDataSchema(),
- mailboxReceiver.getStageId(), exchangeType, exchangeType ==
RelDistribution.Type.HASH_DISTRIBUTED
- ? new FieldSelectionKeySelector(distributionKeys) : null);
+ KeySelector<Object[], Object[]> keySelector = exchangeType ==
RelDistribution.Type.HASH_DISTRIBUTED
+ ? new FieldSelectionKeySelector(distributionKeys) : null;
Review Comment:
Might want to add a comment here to explain the rationale. Something like
this ?
Basically, we currently support two kinds of exchanges (`BROADCAST` and
`HASH_DISTRIBUTE`) via hints. Only in the latter scenario as of now, there is a
case for optimizing the exchange and considering skipping it. If the exchange
type is `BROADCAST`, we can't avoid exchange and we won't have this situation
because otherwise it becomes sort of colocated partitioned join (which I think
will be added later and should have used a different exchange type through a
different hint). This is why the keySelector is null in the first scenario
--
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]