Jackie-Jiang commented on code in PR #14797:
URL: https://github.com/apache/pinot/pull/14797#discussion_r1926093200
##########
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:
Refactored and extracted the common code.
I added a TODO for the validation for hash join because I haven't thought
through which combination is invalid. User might decide to use a certain
distribution based on their data layout, and I don't want to fail them
prematurely.
--
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]