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

snowflake.snowpark.functions.equal_null¶

snowflake.snowpark.functions.equal_null(e1: Union[Column, str], e2: Union[Column, str]) → Column[source]¶

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)]
Copy