-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: keep the original join schema in predicate pushdown #24862
Conversation
@@ -1792,7 +1792,7 @@ func (s *testPlanSuite) TestUpdateEQCond(c *C) { | |||
}{ | |||
{ | |||
sql: "select t1.a from t t1, t t2 where t1.a = t2.a+1", | |||
best: "Join{DataScan(t1)->DataScan(t2)->Projection}(test.t.a,Column#25)->Projection", | |||
best: "Join{DataScan(t1)->DataScan(t2)->Projection}(test.t.a,Column#25)->Projection->Projection", |
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.
This additional projection is added in join reorder, since the schema of the reordered join contains t2.a+1
. These 2 projections would be eliminated in the final physical plan, so I think this test change is fine.
/run-all-tests |
/run-e2e-test |
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
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 23669d3
|
/label needs-cherry-pick-5.0 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.0 in PR #28295 |
What problem does this PR solve?
Issue Number: close pingcap/tiflash#1978
Problem Summary:
Panic caused by join schema changes in predicate pushdown.
What is changed and how it works?
What's Changed:
Keep the original join schema in predicate pushdown, instead of generating a new one from the child operators.
How it Works:
We don't infer NotNull info from scalar functions now, so we don't need to update the join schema in predicate pushdown. I have tried adding a new projection on top of join if the schema changes, it would break a lot of tests, so I simply remove the
mergeSchema()
function call.Related changes
N/A
Check List
Tests
Side effects
N/A
Release note