xuyangzhong opened a new pull request, #28682:
URL: https://github.com/apache/flink/pull/28682
## 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
- Generalized WrapJsonAggFunctionArgumentsRule to operate on the base
Aggregate class and split the single INSTANCE into AGGREGATE_INSTANCE (for
LogicalAggregate) and WINDOW_AGGREGATE_INSTANCE (for LogicalWindowAggregate),
with a generic onAggregateClass(Class<T>) config factory
- Added a hints field to WindowAggregate and its subclasses
(LogicalWindowAggregate, FlinkLogicalWindowAggregate), and implemented
withHints on LogicalWindowAggregate so the rule's marker hint (used to prevent
repeated transformation) is preserved
- Registered both rule instances in FlinkBatchRuleSets and
FlinkStreamRuleSets, and updated the HINT_NAME_JSON_AGGREGATE_WRAPPED
excluded-rules strategy in FlinkHintStrategies
## Verifying this change
New tests are added to verify this pr.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]