flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-34587][table] Introduce MODE aggregate function

Open snuyanzin opened this issue 1 year ago • 3 comments

What is the purpose of the change

The PR introduces support of MODE aggregate function which returns the most frequent element in a group. NULL elements are ignored (as it is happening for other vendors), in case there is no non NULL elements in a group the result will be NULL. In case there are several elements with same frequency one of them will be returned (similar to other vendor's behavior)

Verifying this change

This change added tests and can be verified as follows: flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/OverAggregateITCase.scala flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/aggfunctions/ModeAggFunctionTest.java

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? (yes )
  • If yes, how is the feature documented? (not applicable )

snuyanzin avatar Mar 06 '24 11:03 snuyanzin

CI report:

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

flinkbot avatar Mar 06 '24 11:03 flinkbot

@snuyanzin sorry, I completely missed this for a very long time. Do you still need my review?

affo avatar Mar 14 '25 13:03 affo

This PR is being marked as stale since it has not had any activity in the last 90 days. If you would like to keep this PR alive, please leave a comment asking for a review. If the PR has merge conflicts, update it with the latest from the base branch.

If you are having difficulty finding a reviewer, please reach out to the community, contact details can be found here: https://flink.apache.org/what-is-flink/community/

If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.

github-actions[bot] avatar Jun 13 '25 06:06 github-actions[bot]