Skip to content

Commit

Permalink
Issue-14216 - Support arrays_overlap function
Browse files Browse the repository at this point in the history
  • Loading branch information
erenavsarogullari committed Jan 20, 2025
1 parent acf66d6 commit 90a1448
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
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

0 comments on commit 90a1448

Please sign in to comment.