snowflake.snowpark.functions.as_binary

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

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
语言: 中文