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.26.0/snowpark-python/src/snowflake/snowpark/functions.py#L3473-L3491)¶
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 | ------------