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

Add array_min function support #14416

Open
erenavsarogullari opened this issue Feb 3, 2025 · 3 comments · May be fixed by #14417
Open

Add array_min function support #14416

erenavsarogullari opened this issue Feb 3, 2025 · 3 comments · May be fixed by #14417
Assignees
Labels
enhancement New feature or request

Comments

@erenavsarogullari
Copy link
Member

Is your feature request related to a problem or challenge?

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

Describe the solution you'd like

Adding array_min function support to DataFusion.

Describe alternatives you've considered

No response

Additional context

No response

@erenavsarogullari erenavsarogullari added the enhancement New feature or request label Feb 3, 2025
@erenavsarogullari
Copy link
Member Author

take

@Omega359
Copy link
Contributor

Omega359 commented Feb 3, 2025

Possibly related/tangential: #14392

@erenavsarogullari erenavsarogullari linked a pull request Feb 3, 2025 that will close this issue
@erenavsarogullari
Copy link
Member Author

@Omega359 Thanks for the comment. Yes, this effort is also related with #14392.
I think we have 2 use cases for array_min & array_max functions (and i think this also common requirement for other SQL functions.). They are required for DataFusion end-users (not using Comet) and Comet support is another use-case because Spark supports them natively and DataFusion has not supported yet. We will also need for the mapping on Comet side for Spark queries using this scalar array functions submitted to DataFusion by Comet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants