snowflake.snowpark.functions.as_binary

snowflake.snowpark.functions.as_binary(variant: Union[Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/functions.py#L7288-L7303)

Casts a VARIANT value to a binary string.

Example::
>>> df = session.sql("select to_binary('F0A5')::variant as a")
>>> df.select(as_binary("a").alias("result")).show()
--------------------------
|"RESULT"                |
--------------------------
|bytearray(b'ð¥')  |
--------------------------
Copy
Language: English