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'ð¥') | --------------------------