flink
flink copied to clipboard
[FLINK-31788][table] TableAggregateFunction supports emitUpdateWithRetract
What is the purpose of the change
This pull request supports implementingemitUpdateWithRetract for user-defined TableAggregateFunction, which is a missing feature since blink planner became the default planner.
Brief change log
-
Planning phase Check whether the
emitUpdateWithRetractmethod is implemented. If so, theTableAggsHandleFunction#emitValuemethod should invokeTableAggregateFunction#emitUpdateWithRetractinstead ofTableAggregateFunction#emitValue. Meanwhile, change the collector type toRetractableCollectorand implementRetractableCollector#retract. -
Runtime phase Do not invoke
emitValueto retract previously sent unchanged data.
Verifying this change
This change added tests and can be verified as follows:
TableAggregateITCase#testFlagAggregateWithOrWithoutIncrementalUpdate
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): yes
- 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 because it's a feature already mentioned in doc
- If yes, how is the feature documented? not applicable
CI report:
- 08aacdbe9283f7b719696fe56c09273c1ae10492 Azure: SUCCESS
Bot commands
The @flinkbot bot supports the following commands:@flinkbot run azurere-run the last Azure build