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

snowflake.snowpark.functions.array_construct

snowflake.snowpark.functions.array_construct(*cols: Union[Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L5288-L5313)

Returns an ARRAY constructed from zero, one, or more inputs.

Parameters:

cols – Columns containing the values (or expressions that evaluate to values). The values do not all need to be of the same data type.

Example::
>>> df = session.create_dataframe([[1, 2], [3, 4]], schema=["a", "b"])
>>> df.select(array_construct("a", "b").alias("result")).show()
------------
|"RESULT"  |
------------
|[         |
|  1,      |
|  2       |
|]         |
|[         |
|  3,      |
|  4       |
|]         |
------------
Copy
Language: English