snowflake.snowpark.functions.greatest¶
- snowflake.snowpark.functions.greatest(*columns: ColumnOrName) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/release-v1.3.0/src/snowflake/snowpark/functions.py#L4874-L4887)¶
Returns the largest value from a list of expressions. If any of the argument values is NULL, the result is NULL. GREATEST supports all data types, including VARIANT.
Examples:
>>> df = session.create_dataframe([[1, 2, 3], [2, 4, -1], [3, 6, None]], schema=["a", "b", "c"]) >>> df.select(greatest(df["a"], df["b"], df["c"]).alias("greatest")).collect() [Row(GREATEST=3), Row(GREATEST=4), Row(GREATEST=None)]