-
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: projection should not push the expr that is not fully substituted #38802
Conversation
[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. |
@@ -474,8 +474,8 @@ func (p *LogicalProjection) PredicatePushDown(predicates []expression.Expression | |||
} | |||
} | |||
for _, cond := range predicates { | |||
substituted, newFilter := expression.ColumnSubstitute4PPD(cond, p.Schema(), p.Exprs) | |||
if substituted && !expression.HasGetSetVarFunc(newFilter) { | |||
substituted, hasFailed, newFilter := expression.ColumnSubstituteImpl(cond, p.Schema(), p.Exprs, true) |
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.
It seems we can remove the function ColumnSubstitute4PPD
.
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 after @Reminiscent 's comments are addressed.
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 8103a1e
|
In response to a cherrypick label: new pull request created: #38836. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
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.
Rest LGTM
} | ||
} | ||
hasFail = hasFail || failed || oldChanged != changed |
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.
since fail1Return is true
once failed
is true, it should be returned from L447 already.
once oldChanged != changed
is true, it should be returned from L467 soon.
hasFail
seems always false here below
In response to a cherrypick label: new pull request created: #38837. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #38838. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #38839. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
TiDB MergeCI notify
|
What problem does this PR solve?
Issue Number: close #38736
close #37971
close #35623
Problem Summary:
What is changed and how it works?
An expression is partly changed. And we pushed it down to join.
When join reorder, the join finds that that expression contains a column that cannot be found by any leaf of the join group. The expression is dropped. Thus the result is wrong.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.