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 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 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 because it's a feature already mentioned in doc
  • If yes, how is the feature documented? not applicable

LadyForest avatar Jan 09 '24 15:01 LadyForest

CI report:

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

flinkbot avatar Jan 09 '24 15:01 flinkbot