snowflake.snowpark.functions.equal_null¶
- snowflake.snowpark.functions.equal_null(e1: Union[Column, str], e2: Union[Column, str]) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.29.1/snowpark-python/src/snowflake/snowpark/functions.py#L10999-L11014)¶
Compares whether two expressions are equal. The function is NULL-safe, meaning it treats NULLs as known values for comparing equality. Note that this is different from the EQUAL comparison operator (=), which treats NULLs as unknown values.
Example:
>>> df = session.create_dataframe([[1, 1], [1, None], [None, 2], [None, None]], schema=["a", "b"]) >>> df.select(equal_null(df["a"], df["b"]).alias("equal_null")).collect() [Row(EQUAL_NULL=True), Row(EQUAL_NULL=False), Row(EQUAL_NULL=False), Row(EQUAL_NULL=True)]