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

snowflake.snowpark.functions.contains

snowflake.snowpark.functions.contains(col: Union[Column, str], string: Union[Column, str]) Column[source]

Returns if col contains string for each row. See CONTAINS <https://docs.snowflake.com/en/sql-reference/functions/contains>

Example

>>> df = session.create_dataframe([[1,2], [3,4], [5,5] ], schema=["a","b"])
>>> df.select(contains(col("a"), col("b")).alias("result")).show()
------------
|"RESULT"  |
------------
|False     |
|False     |
|True      |
------------
Copy