diff --git a/src/snowflake/snowpark/functions.py b/src/snowflake/snowpark/functions.py index f55eba8c1d..ae5e159355 100644 --- a/src/snowflake/snowpark/functions.py +++ b/src/snowflake/snowpark/functions.py @@ -7018,6 +7018,18 @@ def array_agg( |] | ------------ + + ``collect_list`` is an alias of ``array_agg`` with the same arguments and + behavior. The two names share this documentation, which is why the example + above uses ``array_agg``. By default, duplicates are retained. + + This example produces an array containing ``[1, 2, 2]``: + + Example using the alias:: + + >>> from snowflake.snowpark.functions import collect_list + >>> df = session.create_dataframe([[2], [1], [2]], schema=["a"]) + >>> result = df.select(collect_list("a").within_group("a").alias("values")).collect() """ ast = build_function_expr("array_agg", [col, is_distinct]) if _emit_ast else None c = _to_col_if_str(col, "array_agg")