snowflake.snowpark.functions.decode¶
- snowflake.snowpark.functions.decode(expr: Union[snowflake.snowpark.column.Column, str], *args: Union[snowflake.snowpark.column.Column, str]) Column[source]¶
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