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
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.
Describe the bug
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
To Reproduce
No response
Expected behavior
No response
Additional context
Found by SQLancer #11030
The text was updated successfully, but these errors were encountered: