flink
flink copied to clipboard
[FLINK-31788][table] TableAggregateFunction supports emitUpdateWithRetract
What is the purpose of the change
This PR is cherry-picked from https://github.com/apache/flink/pull/24051
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 emitValue to 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
- If yes, how is the feature documented? not applicable
CI report:
- 970e31067f5a893ea90b3f8a33064051e597bfe3 Azure: SUCCESS
Bot commands
The @flinkbot bot supports the following commands:@flinkbot run azurere-run the last Azure build