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

snowflake.snowpark.functions.least¶

snowflake.snowpark.functions.least(*columns: Union[Column, str]) → Column[source]¶

Returns the smallest value from a list of expressions. If any of the argument values is NULL, the result is NULL. LEAST supports all data types, including VARIANT.

Example:

>>> df = session.create_dataframe([[1, 2, 3], [2, 4, -1], [3, 6, None]], schema=["a", "b", "c"])
>>> df.select(least(df["a"], df["b"], df["c"]).alias("least")).collect()
[Row(LEAST=1), Row(LEAST=-1), Row(LEAST=None)]
Copy