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

Support arrays_overlap function #14217

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

Conversation

erenavsarogullari
Copy link
Member

@erenavsarogullari erenavsarogullari commented Jan 20, 2025

Which issue does this PR close?

Closes #14216.

What changes are included in this PR?

arrays_overlap function is supported by following query engines:
arrays_overlap: select arrays_overlap(array('hello', world'), array('hello')) => true
References:
Spark: https://docs.databricks.com/en/sql/language-manual/functions/arrays_overlap.html
Snowflake: https://docs.snowflake.com/en/sql-reference/functions/arrays_overlap
Presto: https://prestodb.io/docs/current/functions/array.html#arrays_overlap-x-y-boolean

DataFusion' s array_has_any function aims to have same behavior with arrays_overlap function and it can also be exposed as alias of legacy array_has_any function.

Also, related DataFusion Comet PR: apache/datafusion-comet#1312

Are these changes tested?

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

Are there any user-facing changes?

Yes, new 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 Jan 20, 2025
@erenavsarogullari erenavsarogullari force-pushed the Issue-14216-arrays-overlap-function branch from 1ecd272 to a92a01f Compare January 20, 2025 21:46
@erenavsarogullari erenavsarogullari force-pushed the Issue-14216-arrays-overlap-function branch from a92a01f to 90a1448 Compare January 20, 2025 21:59
Copy link
Contributor

@Omega359 Omega359 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

Support arrays_overlap function
2 participants