snowflake.snowpark.functions.ifnull¶ snowflake.snowpark.functions.ifnull(e1: Union[Column, str], e2: Union[Column, str]) → Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.47.0/src/snowflake/snowpark/functions.py#L11613-L11626)¶ If expr1 is NULL, returns expr2, otherwise returns expr1. Example: CopyExpand>>> df = session.create_dataframe([("a", "b"), ("c", None), (None, "d"), (None, None)], schema=["e1", "e2"]) >>> df.select(ifnull(df["e1"], df["e2"]).alias("result")).collect() [Row(RESULT='a'), Row(RESULT='c'), Row(RESULT='d'), Row(RESULT=None)] Show lessSee moreScroll to top