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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datafusion/functions-nested/src/array_has.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ impl ArrayHasAny {
pub fn new() -> Self {
Self {
signature: Signature::any(2, Volatility::Immutable),
aliases: vec![String::from("list_has_any")],
aliases: vec![String::from("list_has_any"), String::from("arrays_overlap")],
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions datafusion/sqllogictest/test_files/array.slt
Original file line number Diff line number Diff line change
Expand Up @@ -5978,6 +5978,15 @@ select list_has_all(make_array(1,2,3), make_array(4,5,6)),
----
false true false true

query BBBB
select arrays_overlap(make_array(1,2,3), make_array(4,5,6)),
arrays_overlap(make_array(1,2,3), make_array(1,2,4)),
arrays_overlap(make_array(['aa']), make_array(['aa'],['bb'])),
arrays_overlap(make_array('aa',NULL), make_array('bb',NULL))
;
----
false true true true

query ???
select range(column2),
range(column1, column2),
Expand Down
6 changes: 6 additions & 0 deletions docs/source/user-guide/sql/scalar_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2545,6 +2545,7 @@ _Alias of [current_date](#current_date)._
- [array_sort](#array_sort)
- [array_to_string](#array_to_string)
- [array_union](#array_union)
- [arrays_overlap](#arrays_overlap)
- [cardinality](#cardinality)
- [empty](#empty)
- [flatten](#flatten)
Expand Down Expand Up @@ -2929,6 +2930,7 @@ array_has_any(array, sub-array)
#### Aliases

- list_has_any
- arrays_overlap

### `array_indexof`

Expand Down Expand Up @@ -3573,6 +3575,10 @@ array_union(array1, array2)

- list_union

### `arrays_overlap`

_Alias of [array_has_any](#array_has_any)._

### `cardinality`

Returns the total number of elements in the array.
Expand Down
Loading