Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/17191#discussion_r106814663 --- Diff: sql/core/src/test/resources/sql-tests/inputs/group-by.sql --- @@ -35,3 +35,6 @@ FROM testData; -- Aggregate with foldable input and multiple distinct groups. SELECT COUNT(DISTINCT b), COUNT(DISTINCT b, c) FROM (SELECT 1 AS a, 2 AS b, 3 AS c) GROUP BY a; + +-- Aliases in SELECT could be used in GROUP BY +SELECT a AS k, COUNT(b) FROM testData GROUP BY k; --- End diff -- Also add the extra EXPLAIN for us to know whether the plan is correct. ``` EXPLAIN SELECT a AS k, COUNT(b) FROM testData GROUP BY k ```
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org