snowflake.snowpark.functions.base64_decode_binary¶
- snowflake.snowpark.functions.base64_decode_binary(input_expr: Union[snowflake.snowpark.column.Column, str], alphabet: Optional[Union[snowflake.snowpark.column.Column, str]] = None) Column[source]¶
Decodes a base64-encoded string and returns the result as a binary value.
- Parameters:
input_expr (ColumnOrName) – A base64-encoded string to decode.
alphabet (ColumnOrName, optional) – The base64 alphabet to use for decoding. If not specified, uses the standard base64 alphabet.
- Returns:
A binary value containing the decoded result.
- Return type:
- Examples::
>>> from snowflake.snowpark.functions import col, lit >>> df = session.create_dataframe(["SEVMUA=="], schema=["input"]) >>> df.select(base64_decode_binary(col("input")).alias("result")).collect() [Row(RESULT=bytearray(b'HELP'))]
>>> df.select(base64_decode_binary(col('input'), lit('$')).alias('result')).collect() [Row(RESULT=bytearray(b'HELP'))]