Convert listagg to normal annotated aggregation#12398
Closed
dain wants to merge 3 commits intotrinodb:masterfrom
Closed
Convert listagg to normal annotated aggregation#12398dain wants to merge 3 commits intotrinodb:masterfrom
dain wants to merge 3 commits intotrinodb:masterfrom
Conversation
Similar to filtered aggregates, ordered aggregates can involved new symbols not in the original function call, and this optimizer does not support that model.
martint
reviewed
May 17, 2022
| .argumentType(BOOLEAN) | ||
| .build()) | ||
| .nullable() | ||
| .argumentNullability(true, false, false, false, false) |
Member
There was a problem hiding this comment.
"Fix null parameter declaration in listagg"
Add an explanation to the commit message. What's the issue? It's not obvious from this change
Member
Author
|
Merged as part of #11477 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
listagg is currently implemented as a custom/maual aggregation function, but does not need any features unavailable to annotated aggregations.
These changes are extracted from larger PR to rewrite most aggregates as annotated functions . While testing this I found that the SingleDistinctAggregationToGroupBy was causing failures in
io.trino.sql.query.TestListagg.testListaggQueryWithDistinct. I believe this is because the optimizer does not handle aggergates with order sensitive aggregates correctly. I have modified the optimizer to skip ordered aggregates, but I am not sure this is the proper fix.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
(X) No release notes entries required.
( ) Release notes entries required with the following suggested text: