siddharthteotia commented on code in PR #14797:
URL: https://github.com/apache/pinot/pull/14797#discussion_r1924774471
##########
pinot-query-planner/src/main/java/org/apache/pinot/calcite/rel/rules/PinotJoinExchangeNodeInsertRule.java:
##########
@@ -52,22 +54,132 @@ public void onMatch(RelOptRuleCall call) {
RelNode left = PinotRuleUtils.unboxRel(join.getInput(0));
RelNode right = PinotRuleUtils.unboxRel(join.getInput(1));
JoinInfo joinInfo = join.analyzeCondition();
+ Map<String, String> joinHintOptions =
PinotHintOptions.JoinHintOptions.getJoinHintOptions(join);
+ PinotHintOptions.DistributionType leftDistributionType;
+ PinotHintOptions.DistributionType rightDistributionType;
+ if (joinHintOptions != null) {
+ leftDistributionType =
PinotHintOptions.JoinHintOptions.getLeftDistributionType(joinHintOptions);
+ rightDistributionType =
PinotHintOptions.JoinHintOptions.getRightDistributionType(joinHintOptions);
+ } else {
+ leftDistributionType = null;
+ rightDistributionType = null;
+ }
RelNode newLeft;
RelNode newRight;
if (PinotHintOptions.JoinHintOptions.useLookupJoinStrategy(join)) {
- // Lookup join - add local exchange on the left side
- newLeft = PinotLogicalExchange.create(left, RelDistributions.SINGLETON);
+ // Lookup join
Review Comment:
(nit) this function is somewhat less readable. we should consider refactoring
we should also add validation. for example, a query can't have a exchange
hint for left side as BROADCAST and right side as HASH for the same JOIN op.
--
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]