diff --git a/datafusion/functions-nested/src/array_has.rs b/datafusion/functions-nested/src/array_has.rs index 0a3daa18c096..09d9614f8873 100644 --- a/datafusion/functions-nested/src/array_has.rs +++ b/datafusion/functions-nested/src/array_has.rs @@ -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")], } } } diff --git a/datafusion/sqllogictest/test_files/array.slt b/datafusion/sqllogictest/test_files/array.slt index 9a0a25f62066..72915f2bb030 100644 --- a/datafusion/sqllogictest/test_files/array.slt +++ b/datafusion/sqllogictest/test_files/array.slt @@ -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), diff --git a/docs/source/user-guide/sql/scalar_functions.md b/docs/source/user-guide/sql/scalar_functions.md index a64ed597e007..b769b8b7bdb0 100644 --- a/docs/source/user-guide/sql/scalar_functions.md +++ b/docs/source/user-guide/sql/scalar_functions.md @@ -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) @@ -2929,6 +2930,7 @@ array_has_any(array, sub-array) #### Aliases - list_has_any +- arrays_overlap ### `array_indexof` @@ -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.