formatRow, but works on the whole group and can use block-based formats.
Syntax
Parameters
format— Output format name, for exampleJSONEachRow,CSV,TabSeparated.
Arguments
x, y, ...— Expressions to format as rows. At least one argument is required.
Returned value
- A String containing the formatted output for the group.
Column names in the formatted output are generated as
c1, c2, … in the order of arguments.The particular order of formatted rows is not guaranteed.The query’s format settings (for example format_csv_delimiter or output_format_json_quote_64bit_integers) are captured when the aggregate function is initialized and used to produce the output. The output_format_write_statistics setting is always forced off, so the formatted string never contains a statistics section.NULL handling
LikegroupArray and groupConcat, groupFormat skips a row when any of its arguments is NULL; such rows do not appear in the formatted output. When an argument is nullable, the result type is Nullable(String), and a group whose every row is skipped — as well as a literal untyped NULL argument of type Nullable(Nothing) — returns NULL through the generic Null combinator.
Examples
Basic usage with JSONEachRow
groupFormat
Introduced in: v Formats the rows in each group using the specified output format and returns the result as a string. The format name is passed as a parameter, and the arguments are the columns to format. Column names are generated as c1, c2, … in the formatted output. Syntaxformat— Output format name. For example, JSONEachRow, CSV, TabSeparated.String
x, y, ...— Expressions to format as rows.Any
String
Examples
Basic usage
Query
Response