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

snowflake.snowpark.functions.array_contains¶

snowflake.snowpark.functions.array_contains(variant: ColumnOrName, array: ColumnOrName) → Column[source]¶

Returns True if the specified VARIANT is found in the specified ARRAY.

Parameters:
  • variant – Column containing the VARIANT to find.

  • array – Column containing the ARRAY to search.

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