You are viewing documentation about an older version (1.16.0). View latest version

snowflake.snowpark.functions.arrays_overlap

snowflake.snowpark.functions.arrays_overlap(array1: Union[Column, str], array2: Union[Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L3620-L3639)

Compares whether two ARRAYs have at least one element in common. Returns TRUE if there is at least one element in common; otherwise returns FALSE. The function is NULL-safe, meaning it treats NULLs as known values for comparing equality.

Example::
>>> from snowflake.snowpark import Row
>>> df = session.create_dataframe([Row([1, 2], [1, 3]), Row([1, 2], [3, 4])], schema=["a", "b"])
>>> df.select(arrays_overlap("a", "b").alias("result")).show()
------------
|"RESULT"  |
------------
|True      |
|False     |
------------
Copy
Language: English