snowflake.snowpark.functions.decode¶
- snowflake.snowpark.functions.decode(expr: Union[snowflake.snowpark.column.Column, str], *args: Union[snowflake.snowpark.column.Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.42.0/src/snowflake/snowpark/_functions/scalar_functions.py#L1143-L1168)¶
Decodes an expression by comparing it with search values and returning corresponding result values.
Similar to a Case statement, this function compares an expression to one or more search values and returns the corresponding result when a match is found.
- Parameters:
expr (ColumnOrName) – The expression to decode.
*args (ColumnOrName) – Variable length argument list containing pairs of search values and result values, with an optional default value at the end.
- Returns:
The decoded result.
- Return type:
Example