snowflake.snowpark.functions.hex_decode_binary¶

snowflake.snowpark.functions.hex_decode_binary(input_expr: Union[snowflake.snowpark.column.Column, str]) → Column[source]¶

Decodes a hex-encoded string to binary data.

Parameters:

input_expr (ColumnOrName) – the hex-encoded string to decode.

Returns:

the decoded binary data.

Return type:

Column

Example:

>>> df = session.create_dataframe(['48454C4C4F', '576F726C64'], schema=['hex_string'])
>>> df.select(hex_decode_binary(df['hex_string']).alias('decoded_binary')).collect()
[Row(DECODED_BINARY=bytearray(b'HELLO')), Row(DECODED_BINARY=bytearray(b'World'))]
Copy