v.1.1.54362New Feature

Aggregation Behavior Change for Empty Sets in SQL

Aggregation without GROUP BY for an empty set (such as SELECT count(*) FROM table WHERE 0) now returns a result with one row with null values for aggregate functions, in compliance with the SQL standard. To restore the old behavior (return an empty result), set empty_result_for_aggregation_by_empty_set to 1.
Aggregation queries without GROUP BY on an empty dataset now return one row with NULL values for aggregate functions, aligning with the SQL standard.

Why it matters

Previously, aggregation on empty data (e.g., SELECT count(*) FROM table WHERE 0) returned an empty result set. This change ensures compliance with the SQL standard by returning a single row with NULL for aggregate functions when the data set is empty, improving consistency and predictability of query results.

How to use it

By default, the new behavior is enabled. To revert to the old behavior of returning an empty result for such aggregations, set the setting empty_result_for_aggregation_by_empty_set to 1.