snowflake.snowpark.functions.as_array

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

Casts a VARIANT value to an array.

Example::
>>> df = session.sql("select array_construct(1, 2)::variant as a")
>>> df.select(as_array("a").alias("result")).show()
------------
|"RESULT"  |
------------
|[         |
|  1,      |
|  2       |
|]         |
------------
Copy
Language: English