flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-31788][table] TableAggregateFunction supports emitUpdateWithRetract

Open LadyForest opened this issue 1 year ago • 1 comments

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 emitUpdateWithRetract method is implemented. If so, the TableAggsHandleFunction#emitValue method should invoke TableAggregateFunction#emitUpdateWithRetract instead of TableAggregateFunction#emitValue. Meanwhile, change the collector type to RetractableCollector and implement RetractableCollector#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

LadyForest avatar Jan 12 '24 02:01 LadyForest

CI report:

  • 970e31067f5a893ea90b3f8a33064051e597bfe3 Azure: SUCCESS
Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

flinkbot avatar Jan 12 '24 02:01 flinkbot