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

snowflake.snowpark.functions.contains

snowflake.snowpark.functions.contains(col: Union[Column, str], string: Union[Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L2927-L2944)

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
Language: English