These settings are available in system.settings and are autogenerated from source.
How the input formats read columns of the AggregateFunction type.
Possible values:
state — the serialized state of the aggregate function, as the output formats write it (the default).
value — a value of the argument of the aggregate function, or a tuple of the arguments if there are several of them. The value is aggregated to form the state.
array — an array of values, as described in the value option above. All elements of the array are aggregated to form the state.
In the value and array modes the format reads the column as if it had the type of the values: T for AggregateFunction(f, T), Tuple(T1, T2) for AggregateFunction(f, T1, T2), or Array of it in the array mode. The values are written in the representation the format uses for that type: a number or a string in a text format, a JSON array in the JSON formats, the binary encoding of the type in RowBinary or Native, a column of that type in Parquet, and so on. This applies to every input format, and also to AggregateFunction nested in Array, Tuple or Map.
Examples
For a table with structure:
With aggregate_function_input_format = 'value':
With aggregate_function_input_format = 'array':
Note: The value and array formats are slower than the default state format as they require creating and aggregating values during insertion.
aggregate_functions_null_for_empty
Enables or disables rewriting all aggregate functions in a query, adding -OrNull suffix to them. Enable it for SQL standard compatibility.
It is implemented via query rewrite (similar to count_distinct_implementation setting) to get consistent results for distributed queries.
Possible values:
- 0 — Disabled.
- 1 — Enabled.
Example
Consider the following query with aggregate functions:
With aggregate_functions_null_for_empty = 0 it would produce:
With aggregate_functions_null_for_empty = 1 the result would be:
Last modified on September 22, 2026