alamb commented on code in PR #11897:
URL: https://github.com/apache/datafusion/pull/11897#discussion_r1712964157


##########
datafusion/sqllogictest/test_files/aggregate.slt:
##########
@@ -5553,4 +5553,50 @@ drop table employee_csv;
 query I??III?T
 select count(null), min(null), max(null), bit_and(NULL), bit_or(NULL), 
bit_xor(NULL), nth_value(NULL, 1), string_agg(NULL, ',');
 ----
-0 NULL NULL NULL NULL NULL NULL NULL
\ No newline at end of file
+0 NULL NULL NULL NULL NULL NULL NULL
+
+statement ok
+create table t1(v1 int);
+
+query R
+SELECT AVG(v1) FROM t1 having false;
+----
+
+query TT
+explain SELECT AVG(v1) FROM t1 GROUP BY false having false;
+----
+logical_plan EmptyRelation
+physical_plan EmptyExec
+
+
+query TT
+EXPLAIN SELECT AVG(v1) FROM t1 GROUP BY 1 != 1 having 1 != 1;
+----
+logical_plan EmptyRelation
+physical_plan EmptyExec
+
+query TT
+EXPLAIN SELECT AVG(v1) FROM t1 GROUP BY 1 + 1 = -1 having 1 + 1 = -1;
+----
+logical_plan EmptyRelation
+physical_plan EmptyExec
+
+query R
+SELECT AVG(v1) FROM t1 GROUP BY false having true;
+----

Review Comment:
   I think the output here should have a single row  -- it should be the same 
result as `SELECT AVG(v1) FROM t1 GROUP BY false` 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to