Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add array_min function support #14417

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erenavsarogullari
Copy link
Member

Which issue does this PR close?

Closes #14416.

What changes are included in this PR?

Currently, Spark, Snowflake and Presto support array_min function. This can also be useful for DataFusion.

array_min(make_array(3,1,4,2)) => 1
array_min(make_array('h','e','l','l',NULL,'o')) => e
array_min(make_array(NULL,NULL)) => NULL

Spark: https://docs.databricks.com/en/sql/language-manual/functions/array_min.html
Snowflake: https://docs.snowflake.com/en/sql-reference/functions/array_min
Presto: https://prestodb.io/docs/current/functions/array.html#array_min-x-x

All potential use-cases have been covered like different data_types, empty array, NULL etc.

Also, planning to add array_max function as follow-up.

Are these changes tested?

Added new UT cases to verify array_min function in terms of different source arrays.

Are there any user-facing changes?

Yes, new SQL function is supported and documentation has also be updated.

@github-actions github-actions bot added documentation Improvements or additions to documentation sqllogictest SQL Logic Tests (.slt) labels Feb 3, 2025
@erenavsarogullari erenavsarogullari force-pushed the array_min_function branch 3 times, most recently from 5640e5d to 639f8ce Compare February 4, 2025 02:37
@erenavsarogullari erenavsarogullari changed the title feat: Add array_min function feat: Add array_min function support Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add array_min function support
1 participant