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

snowflake.snowpark.functions.as_array

snowflake.snowpark.functions.as_array(variant: ColumnOrName) Column[source]

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