Skip to content

[multistage][bug-fix] Fix the join condition order different from join table order#9350

Merged
walterddr merged 3 commits intoapache:masterfrom
61yao:join_order
Sep 13, 2022
Merged

[multistage][bug-fix] Fix the join condition order different from join table order#9350
walterddr merged 3 commits intoapache:masterfrom
61yao:join_order

Conversation

@61yao
Copy link
Contributor

@61yao 61yao commented Sep 9, 2022

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.

@codecov-commenter
Copy link

codecov-commenter commented Sep 9, 2022

Codecov Report

Merging #9350 (da9cfc5) into master (1806676) will decrease coverage by 1.21%.
The diff coverage is 100.00%.

@@             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     
Flag Coverage Δ
integration1 26.23% <0.00%> (+0.07%) ⬆️
integration2 ?
unittests1 66.96% <100.00%> (+0.03%) ⬆️
unittests2 15.35% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...a/org/apache/pinot/query/planner/PlannerUtils.java 100.00% <ø> (+9.52%) ⬆️
...not/query/planner/logical/RelToStageConverter.java 75.00% <100.00%> (ø)
...g/apache/pinot/server/api/resources/ErrorInfo.java 0.00% <0.00%> (-100.00%) ⬇️
...t/core/plan/StreamingInstanceResponsePlanNode.java 0.00% <0.00%> (-100.00%) ⬇️
...ore/operator/streaming/StreamingResponseUtils.java 0.00% <0.00%> (-100.00%) ⬇️
...server/starter/helix/SegmentReloadStatusValue.java 0.00% <0.00%> (-100.00%) ⬇️
.../operator/blocks/results/MetadataResultsBlock.java 0.00% <0.00%> (-100.00%) ⬇️
...ager/realtime/PeerSchemeSplitSegmentCommitter.java 0.00% <0.00%> (-100.00%) ⬇️
...urces/ServerReloadControllerJobStatusResponse.java 0.00% <0.00%> (-100.00%) ⬇️
...ator/streaming/StreamingSelectionOnlyOperator.java 0.00% <0.00%> (-90.00%) ⬇️
... and 163 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Can you double check it works for Equal case. The test cases pass but I am not fully sure.

@Jackie-Jiang Jackie-Jiang added the multi-stage Related to the multi-stage query engine label Sep 13, 2022
Copy link
Contributor

@siddharthteotia siddharthteotia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rebase please ?

@walterddr walterddr merged commit 48c0ab4 into apache:master Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multi-stage Related to the multi-stage query engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants