gortiz commented on code in PR #12704:
URL: https://github.com/apache/pinot/pull/12704#discussion_r1565385608


##########
pinot-query-planner/src/main/java/org/apache/pinot/calcite/rel/rules/PinotJoinToDynamicBroadcastRule.java:
##########
@@ -164,11 +165,15 @@ public void onMatch(RelOptRuleCall call) {
     //    2. when hash key are the same but hash functions are different, it 
can be done via normal hash shuffle.
     boolean isColocatedJoin = 
PinotHintStrategyTable.isHintOptionTrue(join.getHints(),
         PinotHintOptions.JOIN_HINT_OPTIONS, 
PinotHintOptions.JoinHintOptions.IS_COLOCATED_BY_JOIN_KEYS);
-    PinotLogicalExchange dynamicBroadcastExchange = isColocatedJoin
-        ? PinotLogicalExchange.create(right.getInput(), 
RelDistributions.hash(join.analyzeCondition().rightKeys),
-        PinotRelExchangeType.PIPELINE_BREAKER)
-        : PinotLogicalExchange.create(right.getInput(), 
RelDistributions.BROADCAST_DISTRIBUTED,
-            PinotRelExchangeType.PIPELINE_BREAKER);
+    PinotLogicalExchange dynamicBroadcastExchange;
+    RelNode rightInput = right.getInput();
+    if (isColocatedJoin) {
+      RelDistribution dist = 
RelDistributions.hash(join.analyzeCondition().rightKeys);
+      dynamicBroadcastExchange = PinotLogicalExchange.create(rightInput, dist, 
PinotRelExchangeType.PIPELINE_BREAKER);
+    } else {
+      RelDistribution dist = RelDistributions.BROADCAST_DISTRIBUTED;
+      dynamicBroadcastExchange = PinotLogicalExchange.create(rightInput, dist, 
PinotRelExchangeType.PIPELINE_BREAKER);
+    }

Review Comment:
   This is the same code as before, but easier to read and to debug. The former 
is subjective, so I'm open to rollback this change if required



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