snowflake.snowpark.functions.array_agg¶
- snowflake.snowpark.functions.array_agg(col: Union[Column, str], is_distinct: bool = False) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L5180-L5199)¶
Returns the input values, pivoted into an ARRAY. If the input is empty, an empty ARRAY is returned.
- Example::
>>> df = session.create_dataframe([[1], [2], [3], [1]], schema=["a"]) >>> df.select(array_agg("a", True).alias("result")).show() ------------ |"RESULT" | ------------ |[ | | 1, | | 2, | | 3 | |] | ------------