siddharthteotia commented on code in PR #9100:
URL: https://github.com/apache/pinot/pull/9100#discussion_r937194170


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/rules/PinotJoinExchangeNodeInsertRule.java:
##########
@@ -70,17 +70,17 @@ public void onMatch(RelOptRuleCall call) {
     RelNode leftExchange;
     RelNode rightExchange;
     List<RelHint> hints = join.getHints();
-    if (hints.contains(PinotRelationalHints.USE_HASH_DISTRIBUTE)) {
+    if (hints.contains(PinotRelationalHints.USE_BROADCAST_DISTRIBUTE)) {
+      leftExchange = LogicalExchange.create(leftInput, 
RelDistributions.RANDOM_DISTRIBUTED);
+      rightExchange = LogicalExchange.create(rightInput, 
RelDistributions.BROADCAST_DISTRIBUTED);

Review Comment:
   I don't follow this. If hint indicates to use BROADCAST_EXCHANGE, then why 
are we setting up exchanges for both sides of the JOIN ? In broadcast, only one 
side (either left or right) should be exchanged / moved, whereas other side 
remains as opposed to full shuffle based JOIN where data movement involves both 
sides.



##########
pinot-query-planner/src/main/java/org/apache/pinot/query/rules/PinotJoinExchangeNodeInsertRule.java:
##########
@@ -70,17 +70,17 @@ public void onMatch(RelOptRuleCall call) {
     RelNode leftExchange;
     RelNode rightExchange;
     List<RelHint> hints = join.getHints();
-    if (hints.contains(PinotRelationalHints.USE_HASH_DISTRIBUTE)) {
+    if (hints.contains(PinotRelationalHints.USE_BROADCAST_DISTRIBUTE)) {
+      leftExchange = LogicalExchange.create(leftInput, 
RelDistributions.RANDOM_DISTRIBUTED);
+      rightExchange = LogicalExchange.create(rightInput, 
RelDistributions.BROADCAST_DISTRIBUTED);

Review Comment:
   I don't follow this. If hint indicates to use `BROADCAST_EXCHANGE`, then why 
are we setting up exchanges for both sides of the JOIN ? In broadcast, only one 
side (either left or right) should be exchanged / moved, whereas other side 
remains as opposed to full shuffle based JOIN where data movement involves both 
sides.



-- 
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