-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
planner: fix union statements order #8214
Conversation
Hi contributor, thanks for your PR. This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@mtunique |
@mtunique Should we cherrypick this PR to the release-2.1 and release-2.0 branch? |
@zz-jason Maybe it's necessary. |
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@mtunique It should be noted that, the directory structure |
What problem does this PR solve?
Fix #8202 union statements order because union result schema info isn't correct.
What is changed and how it works?
Because union schema is the same to its first children. MySQL UNION Syntax
But when mix UNION ALL and UNION DISTINCT in the same query, allSelectPlans is in front of unionDistinctPlan. When call buildUnionAll , the schema become incorrect. We should change the order, it should be same to SQL.
Check List
Tests
Unit test
Related changes
Need to cherry-pick to the release branch