You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect results of aggregation with grouping sets with single target partition #16965
When datafusion.execution.target_partitions is set to 1 then following query gives incorrect results -- select id from (select 'id' as id union all select 'id' as id order by id) group by grouping sets ((id), ());
To Reproduce
Run following in datafusion-cli
DataFusion CLI v49.0.0
> set datafusion.execution.target_partitions = 1;
0 row(s) fetched.
Elapsed 0.013 seconds.
> select id from (select 'id' as id union all select 'id' as id order by id) group by grouping sets ((id), ());
+------+
| id |
+------+
| id |
| NULL |
| id |
+------+
3 row(s) fetched.
Elapsed 0.016 seconds.
Expected behavior
Query should give following result
+------+
| id |
+------+
| id |
| NULL |
+------+
Additional context
Postgres gives following
psql (17.5 (Homebrew))
Type "help" for help.
postgres=# select id from (select 'id' as id union all select 'id' as id) group by grouping sets ((id), ());
id
----
id
(2 rows)
Activity
chenkovsky commentedon Jul 30, 2025
take
test: cover grouping set equivalences and constants
test: cover grouping set equivalences and constants (apache#26898)