Description
The group_concat function is used to concatenate a group of string values into a single string. This function is very useful when dealing with multiple rows or records, as it can merge results from the same group into one string, commonly used in report generation and data aggregation scenarios.
Syntax
Parameters
expression: The column or expression to concatenate.sep_string: (Optional) The string used as a separator. If omitted, Lakehouse uses a comma (,) as the default separator.
Return Results
- Returns a string containing all concatenated non-
NULLvalues, separated by the specified delimiter.
Example Usage
Notes
- If the resulting string exceeds the system's maximum length limit,
group_concatmay throw an error. In Lakehouse, this limit can be adjusted by setting the table propertycz.storage.write.max.string.bytessystem variable. - When using the
group_concatfunction, note thatNULLvalues will be ignored and not included in the final string.
