Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(planner): fix distributed query plan #14951

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

Dousir9
Copy link
Member

@Dousir9 Dousir9 commented Mar 14, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Since some join types cannot perform broadcast join, so CommuteJoin cannot be executed after CascadesOptimizer.
This bug was discovered by an existing test while advancing #14872.

  • Fixes #[Link the issue here]

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Covered by existing test

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@Dousir9 Dousir9 changed the title chore: fix distributed query plan chore(planner): fix distributed query plan Mar 14, 2024
@github-actions github-actions bot added the pr-chore this PR only has small changes that no need to record, like coding styles. label Mar 14, 2024
@Dousir9 Dousir9 requested review from xudong963 and leiysky and removed request for xudong963 March 14, 2024 13:21
@Dousir9 Dousir9 marked this pull request as ready for review March 14, 2024 13:21
@xudong963
Copy link
Member

Since some join types cannot perform broadcast join, so CommuteJoin cannot be executed after CascadesOptimizer.

Why?

@Dousir9
Copy link
Member Author

Dousir9 commented Mar 15, 2024

Since some join types cannot perform broadcast join, so CommuteJoin cannot be executed after CascadesOptimizer.

Why?

Because CascadesOptimizer will generate a distributed query plan, when broadcast join is applied to left outer join, if CommuteJoin changes it to right outer join, the broadcast will appear on the probe side, which will lead to wrong query results.

@Dousir9 Dousir9 added this pull request to the merge queue Mar 15, 2024
Merged via the queue into databendlabs:main with commit 42b5133 Mar 15, 2024
93 checks passed
@Dousir9 Dousir9 deleted the fix_distributed_query_plan branch March 15, 2024 06:08
yufan022 pushed a commit to yufan022/databend that referenced this pull request Jun 13, 2024
chore: fix distributed query plan
(cherry picked from commit 42b5133)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-chore this PR only has small changes that no need to record, like coding styles.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants