-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Remove empty UPDATE
#13755
Remove empty UPDATE
#13755
Conversation
public class TestRemoveEmptyUpdate | ||
extends BaseRuleTest | ||
{ | ||
@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.
I'm inexperienced in the query planning area of Trino so I'd very much benefit of some hints regarding to improve/extend the tests for this fix.
UPDATE
UPDATE
with VALUES
node containing 0
value
UPDATE
with VALUES
node containing 0
valueUPDATE
Replace the `UPDATE` plan node with an empty `VALUES` node when the predicate is optimized to `false`.
0806c6c
to
d85660b
Compare
.addAll(RemoveEmptyDeleteRuleSet.rules()) | ||
.add(new RemoveEmptyUpdate()) |
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.
for Delete we have a rule set (since we match empty delete with and without an exchange).
wonder whether this is some left over (or otherwise: why don't we need same for Update?)
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.
followed up with #13794
RN are meant to be understood by users. I will reformulate this -- #13723 (comment) |
Description
Replace the
UPDATE
plan node with an emptyVALUES
node when the predicate is optimized tofalse
.Fix
Core query engine
Support queries like the following:
Related issues, pull requests, and links
Fixes #12422
This PR takes inspiration from the commit 02be06c which was dealing with empty
DELETE
plan nodes.Documentation
(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
(x) Release notes entries required with the following suggested text: