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

snowflake.snowpark.functions.listagg¶

snowflake.snowpark.functions.listagg(e: ColumnOrName, delimiter: str = '', is_distinct: bool = False) → Column[source]¶

Returns the concatenated input values, separated by delimiter string. See LISTAGG for details.

Parameters:
  • e – A Column object or column name that determines the values to be put into the list.

  • delimiter – A string delimiter.

  • is_distinct – Whether the input expression is distinct.

Examples:

df.group_by(df.col1).agg(listagg(df.col2. ",")).within_group(df.col2.asc())
df.select(listagg(df["col2"], ",", False)
Copy