Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
review: fix grouping set edge case
  • Loading branch information
2010YOUY01 committed Sep 28, 2026
commit 31fe82f87b79d617c0b34b4f45d4d803fcc135fc
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/aggregates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ impl AggregateExec {
let group_by = group_by.into();
let filter_expr = filter_expr.into();

if group_by.is_empty() && aggr_expr.is_empty() {
if group_by.is_true_no_grouping() && aggr_expr.is_empty() {
return internal_err!(
"Grouping expressions and aggregate expressions cannot both be empty"
);
Expand Down
6 changes: 6 additions & 0 deletions datafusion/sqllogictest/test_files/grouping.slt
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@ SELECT COUNT(*) FROM test GROUP BY GROUPING SETS (());
----
2

# An empty grouping set is valid even without aggregate expressions.
query I
SELECT 1 FROM test GROUP BY GROUPING SETS (());
----
1

# grouping_sets_with_empty_set
query I
SELECT SUM(v1) FROM generate_series(10) AS t1(v1) GROUP BY GROUPING SETS(())
Expand Down
Loading