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

snowflake.snowpark.functions.array_construct_compact

snowflake.snowpark.functions.array_construct_compact(*cols: Union[Column, str]) Column[source]

Returns an ARRAY constructed from zero, one, or more inputs. The constructed ARRAY omits any NULL input values.

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, None, 2], [3, None, 4]], schema=["a", "b", "c"])
>>> df.select(array_construct_compact("a", "b", "c").alias("result")).show()
------------
|"RESULT"  |
------------
|[         |
|  1,      |
|  2       |
|]         |
|[         |
|  3,      |
|  4       |
|]         |
------------
Copy