flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-32256][table] Add built-in ARRAY_ MIN function.

Open hanyuzheng7 opened this issue 1 year ago • 3 comments

What is the purpose of the change

This is an implementation of ARRAY_MIN

Brief change log

The array_min() function get the minimum element from input array. The result matches the type of the elements. NULL elements are skipped. If array is empty, or contains only NULL elements, NULL is returned.

Arguments

array: Any ARRAY with elements for which order is supported.

Syntax array_min(array)

Returns The result matches the type of the elements. NULL elements are skipped. If array is empty, or contains only NULL elements, NULL is returned.

Examples

SQL

> SELECT array_min(array(1, 20, NULL, 3)); 
result: 1

See also spark: https://spark.apache.org/docs/latest/api/sql/index.html#array_min

presto https://prestodb.io/docs/current/functions/array.html

Verifying this change

This change added tests in CollectionFunctionsITCase.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

hanyuzheng7 avatar Jun 30 '23 20:06 hanyuzheng7

CI report:

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

flinkbot avatar Jun 30 '23 20:06 flinkbot

@flinkbot run azure

hanyuzheng7 avatar Jun 30 '23 21:06 hanyuzheng7

@flinkbot run azure

hanyuzheng7 avatar Jul 06 '23 03:07 hanyuzheng7

subsumed by #24071

dawidwys avatar Jan 12 '24 09:01 dawidwys