-
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
Fix output symbols of PushFilterThroughBoolOrAggregation optimizer #22716
Fix output symbols of PushFilterThroughBoolOrAggregation optimizer #22716
Conversation
ProjectNode newProjectNode = new ProjectNode( | ||
context.getIdAllocator().getNextId(), | ||
newAggregationNode, | ||
Assignments.builder() | ||
.putIdentities(source.getOutputSymbols()) | ||
.putIdentities(otherSymbols) |
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.
Use newAggregationNode.getOutputSymbols()
and filtering is not required
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.
Please use newAggregationNode
instead.
b2296b3
to
8cc6691
Compare
@Dith3r thanks, updated. |
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.
Please add the failing query as a test in io.trino.sql.query.TestCorrelatedAggregation#testBoolOrAggregation
LGTM otherwise
8cc6691
to
4b0582b
Compare
Added test case and verified failure w/o fix vs pass w the fix. |
Description
PushFilterThroughBoolOrAggregation optimizer may return more output symbol than original plan.
and cause error
Fixing this issue by using output symbols from aggregation node instead of its source.
Additional context and related issues
example query to reproduce:
or see new unit test.
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text: