-
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: fix column pruning bug for Apply and Join #24369
planner: fix column pruning bug for Apply and Join #24369
Conversation
Signed-off-by: guo-shaoge <[email protected]>
Signed-off-by: guo-shaoge <[email protected]>
/run-all-tests |
planner/core/rule_column_pruning.go
Outdated
@@ -431,3 +443,24 @@ func (p *LogicalLimit) PruneColumns(parentUsedCols []*expression.Column) error { | |||
func (*columnPruner) name() string { | |||
return "column_prune" | |||
} | |||
|
|||
func addConstOneForEmptyProjection(p LogicalPlan) (err error) { |
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.
func addConstOneForEmptyProjection(p LogicalPlan) (err error) { | |
func addConstOneForEmptyProjection(p LogicalPlan) { |
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.
done
Signed-off-by: guo-shaoge <[email protected]>
Signed-off-by: guo-shaoge <[email protected]>
/run-all-tests |
/run-mybatis-test |
[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 writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: eac8a25
|
/run-unit-test |
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
/run-cherry-picker |
cherry pick to release-5.0 in PR #24437 |
Signed-off-by: ti-srebot <[email protected]>
Signed-off-by: guo-shaoge [email protected]
What problem does this PR solve?
Issue Number: close #23887
Problem Summary:
Projection
col1
, Its index is 0(becauseProjection
's output columns are all pruned)Projection
is eliminated, because its output columns are all pruned. But Index Join still has output columnseq("abc", tbl1.col1)
. Because use index 0 to eval tbl1.col1Apply
also has this problem. So here I also fix this for Apply.What is changed and how it works?
What's Changed: For
LogicalJoin
andLogicalApply
, if they haveProjection
child, we donot prune all columns inProjection
. IfProjection
is pruned to empty, we make it aProjection 1
(just like count(1))Related changes
Check List
Tests
Side effects:
Release note