[multistage][bug-fix] Fix the join condition order different from join table order#9350
Merged
walterddr merged 3 commits intoapache:masterfrom Sep 13, 2022
Merged
[multistage][bug-fix] Fix the join condition order different from join table order#9350walterddr merged 3 commits intoapache:masterfrom
walterddr merged 3 commits intoapache:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9350 +/- ##
============================================
- Coverage 69.71% 68.50% -1.22%
+ Complexity 5079 4778 -301
============================================
Files 1884 1885 +1
Lines 100277 100388 +111
Branches 15253 15276 +23
============================================
- Hits 69909 68769 -1140
- Misses 25422 26688 +1266
+ Partials 4946 4931 -15
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
walterddr
reviewed
Sep 9, 2022
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/PlannerUtils.java
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
so instead of getting this from join.getCondition() you cando
JoinInfo joinInfo = join.analyzeCondition();
RelNode leftInput = join.getInput(0);
RelNode rightInput = join.getInput(1);
RexNode eqCondition = joinInfo.getEquiCondition(leftInput, rightInput, join.getCluster().getRexBuilder());
this eqCondition already creates out the join key input reference (in left/right order)
Contributor
Author
There was a problem hiding this comment.
Done. Can you double check it works for Equal case. The test cases pass but I am not fully sure.
walterddr
reviewed
Sep 10, 2022
...uery-planner/src/main/java/org/apache/calcite/rel/rules/PinotJoinExchangeNodeInsertRule.java
Outdated
Show resolved
Hide resolved
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/PlannerUtils.java
Outdated
Show resolved
Hide resolved
...-query-planner/src/main/java/org/apache/pinot/query/planner/logical/RelToStageConverter.java
Outdated
Show resolved
Hide resolved
siddharthteotia
approved these changes
Sep 13, 2022
Contributor
siddharthteotia
left a comment
There was a problem hiding this comment.
Can you rebase please ?
37195cb to
c766f2c
Compare
walterddr
approved these changes
Sep 13, 2022
31 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When join condition order is different from join table order, we deduct the column ref wrong.
This implementation fixes it by taking a look at the join condition ref and deduct the right ref hash code.