-
Notifications
You must be signed in to change notification settings - Fork 6k
planner: add back children's Schema
when checking LogicalJoin
's used columns in column pruning
#60694
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
Conversation
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.
Pull Request Overview
This PR restores the previous logic in LogicalJoin by bringing back the usage of each child’s Schema (via FullSchema) when checking for used columns, addressing cases where outdated columns may persist after projection elimination.
- Introduces local variables lFullSchema and rFullSchema to capture children’s FullSchema.
- Adjusts conditional checks to consider both the original Schema and FullSchema for column containment.
Files not reviewed (2)
- tests/integrationtest/r/planner/core/issuetest/planner_issue.result: Language not supported
- tests/integrationtest/t/planner/core/issuetest/planner_issue.test: Language not supported
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #60694 +/- ##
================================================
+ Coverage 73.1255% 74.0250% +0.8994%
================================================
Files 1716 1716
Lines 475616 479130 +3514
================================================
+ Hits 347797 354676 +6879
+ Misses 106435 103055 -3380
- Partials 21384 21399 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, winoros The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest-required |
/retest |
/cherry-pick release-8.5 |
Signed-off-by: ti-chi-bot <[email protected]>
@time-and-fate: new pull request created to branch In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
…sed columns in column pruning (pingcap#60694) close pingcap#60692
What problem does this PR solve?
Issue Number: close #60692
Problem Summary:
As said in the issue, sometimes the
FullSchema
may contain outdatedColumn
s after the projection elimination.We should have fixed the
FullSchema
, but considering the long-standing problems in schema maintenance and column pruning in tidb, we can't make sure we won't introduce any new risk.This PR is likely to be cherry-picked to the LTS version quickly. So it's better to just restore the previous checking logic, i.e., use the
Schema()
to do the check.What changed and how does it work?
Add back what's been removed in #51057 in
(*LogicalJoin).ExtractUsedCols()
.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.