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 result returned by a group by query (SQLancer-TLP) #11748
The below query should return an empty set, since having is evaluated after aggregation, when it's predicate is false, the final result should always be empty.
I have also checked in DuckDB and PostgreSQL, and they all return an empty set.
Reproducer in datafusion-cli
DataFusion CLI v40.0.0
> create table t1(v1 int);
0 row(s) fetched.
Elapsed 0.085 seconds.
> SELECT AVG(v1) FROM t1 GROUP BY false having false;
+------------+
| avg(t1.v1) |
+------------+
| |
+------------+
1 row(s) fetched.
Elapsed 0.095 seconds.
Activity
Lordworms commentedon Jul 31, 2024
take
HairstonE commentedon May 10, 2026
take
fix: eliminate group by constant empty input (apache#22132)
fix: eliminate group by constant empty input (apache#22132)