andygrove commented on code in PR #2464:
URL: https://github.com/apache/arrow-datafusion/pull/2464#discussion_r866406033


##########
datafusion/core/tests/sql/group_by.rs:
##########
@@ -232,6 +232,27 @@ async fn csv_query_group_by_avg() -> Result<()> {
     Ok(())
 }
 
+#[tokio::test]
+async fn csv_query_group_by_with_aliases() -> Result<()> {
+    let ctx = SessionContext::new();
+    register_aggregate_csv(&ctx).await?;
+    let sql = "SELECT c1 AS c12, avg(c12) AS c1 FROM aggregate_test_100 GROUP 
BY c1";

Review Comment:
   This originally failed with:
   
   ```
   Aggregations require unique expression names but the expression 
\\\"AVG(#aggregate_test_100.c12)\\\" at position 0 and 
\\\"AVG(#aggregate_test_100.c12)\\\" at position 1 have the same name. Consider 
aliasing (\\\"AS\\\") one of them
   ```



-- 
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