jonahgao commented on code in PR #9228:
URL: https://github.com/apache/arrow-datafusion/pull/9228#discussion_r1489801697


##########
datafusion/sqllogictest/test_files/aggregate.slt:
##########
@@ -3179,3 +3179,23 @@ NULL
 statement ok
 DROP TABLE t;
 
+
+# Test for the case when the column name is ambiguous
+statement ok
+CREATE TABLE t(a BIGINT) AS VALUES(1), (2), (3);
+
+# The column name referenced by GROUP-BY is ambiguous
+query I
+SELECT 0 as "t.a" FROM t GROUP BY t.a;
+----
+0
+0
+0
+
+# The column name referenced by HAVING is ambiguous
+query I
+SELECT 0 AS "t.a" FROM t HAVING MAX(t.a) = 0;

Review Comment:
   The generation of the HAVING expression uses the same schema as GROUP BY.
   The changes in this PR will also keep the result of this statement 
consistent with PostgreSQL.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to