aggregate_function_input_format
How the input formats read columns of theAggregateFunction 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 thevalueoption above. All elements of the array are aggregated to form the state.
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:
aggregate_function_input_format = 'value':
aggregate_function_input_format = 'array':
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.
aggregate_functions_null_for_empty = 0 it would produce:
aggregate_functions_null_for_empty = 1 the result would be: