-
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: disable projection elimination for select plan of update #10962
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10962 +/- ##
===============================================
+ Coverage 81.274% 81.4776% +0.2036%
===============================================
Files 423 423
Lines 90094 90793 +699
===============================================
+ Hits 73223 73976 +753
+ Misses 11575 11512 -63
- Partials 5296 5305 +9 |
/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
updt.SelectPlan, err = DoOptimize(b.optFlag, p) | ||
// We cannot apply projection elimination when building the subplan, because | ||
// columns in orderedList cannot be resolved. | ||
updt.SelectPlan, err = DoOptimize(b.optFlag&^flagEliminateProjection, p) |
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.
I'm not sure whether there will be some bugs if we disable the projection elimination rule. As you mentioned in the PR description that "The root cause of the error is that during projection elimination, we do not resolve columns in OrderedList
field of Update
", can we fix this issue in the projection elimination rule for the Update
operator?
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.
Then we need to pass an additional parameter of type Assignment
to DoOptimize
, it is pretty ugly and ad-hoc IMHO.
Can we set Update.Schema to the SelectPlan.Schema after SelectPlan is optimized? |
@XuHuaiyu The error is raised because column in |
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
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
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
…ngcap#10962) Conflicts: planner/core/cbo_test.go planner/core/logical_plan_builder.go
What problem does this PR solve?
Before this PR:
What is changed and how it works?
The root cause of the error is that during projection elimination, we do not resolve columns in
OrderedList
field ofUpdate
, so this PR avoid this by reset the flagProjectionElimination when building select plan for update.Check List
Tests
Code changes
N/A
Side effects
N/A
Related changes