You are viewing documentation about an older version (1.15.0). View latest version

snowflake.snowpark.functions.as_binary¶

snowflake.snowpark.functions.as_binary(variant: Union[Column, str]) → Column[source]¶

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