[FLINK-40095][table-planner] Fix JSON aggregation functions failing in group window aggregate#28682
Open
xuyangzhong wants to merge 2 commits into
Open
[FLINK-40095][table-planner] Fix JSON aggregation functions failing in group window aggregate#28682xuyangzhong wants to merge 2 commits into
xuyangzhong wants to merge 2 commits into
Conversation
…n group window aggregate
Collaborator
raminqaf
reviewed
Jul 8, 2026
raminqaf
left a comment
Contributor
There was a problem hiding this comment.
Thanks @xuyangzhong! I did a quick first pass.
| new FlinkLogicalWindowAggregate( | ||
| tableAgg.getCluster(), | ||
| tableAgg.getTraitSet(), | ||
| Collections.emptyList(), |
Contributor
There was a problem hiding this comment.
Here and everywhere else please use List.of()
Contributor
There was a problem hiding this comment.
Beside that, shouldn't we here also pass the hint?
Contributor
Author
There was a problem hiding this comment.
This is because FlinkLogicalWindowTableAggregate is not a hintable node.
Contributor
Author
|
Thanks for your review @raminqaf ! Updated |
raminqaf
reviewed
Jul 8, 2026
raminqaf
left a comment
Contributor
There was a problem hiding this comment.
Thanks for addressing! Left two nits. Should be good in the next round!
| val logicalWindowAgg = new LogicalWindowAggregate( | ||
| ts.getCluster, | ||
| ts.getTraitSet, | ||
| util.List.of(), |
Contributor
There was a problem hiding this comment.
nit:
Suggested change
| util.List.of(), | |
| List.of(), |
| val windowAgg = new LogicalWindowAggregate( | ||
| ts.getCluster, | ||
| ts.getTraitSet, | ||
| java.util.List.of(), |
Contributor
There was a problem hiding this comment.
nit: import java.util
Suggested change
| java.util.List.of(), | |
| List.of(), |
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.
What is the purpose of the change
This pull request fixes JSON aggregation functions (JSON_OBJECTAGG / JSON_ARRAYAGG) failing when used in a group window aggregate (e.g. GROUP BY TUMBLE(...)). Previously, WrapJsonAggFunctionArgumentsRule only matched LogicalAggregate, so JSON aggregate arguments were never wrapped into JSON_STRING when the aggregation was a LogicalWindowAggregate, leading to a failure during planning. This change extends the rule to also cover window aggregates.
Brief change log
Verifying this change
New tests are added to verify this pr.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation