ARRAYS_OVERLAP()

All functions > ARRAY > ARRAYS_OVERLAP()

Returns TRUE if any elements are common between the two arrays.

Signatures

Returns: TRUE if arrays share at least one element, FALSE otherwise

ARRAYS_OVERLAP(array1: ARRAY<T>, array2: ARRAY<T>) → BOOLEAN
sql
ParameterTypeRequiredDescription
array1ARRAY<T>YesFirst array to check
array2ARRAY<T>YesSecond array to check

Notes

  • Returns TRUE if arrays have any common elements
  • Returns FALSE if arrays have no common elements
  • Empty arrays return false
  • Uses element equality comparison

See also

Examples

FeatureQL
SELECT
    -- Shares element 2
    f1 := ARRAYS_OVERLAP(ARRAY(1, 2), ARRAY(2, 3)),
    -- Disjoint arrays
    f2 := ARRAYS_OVERLAP(ARRAY(1, 2), ARRAY(3, 4)),
    -- Empty array
    f3 := ARRAYS_OVERLAP(ARRAY()::BIGINT[], ARRAY(1))
;
Result
f1 BOOLEANf2 BOOLEANf3 BOOLEAN
truefalsefalse

Last update at: 2026/06/20 10:08:10