Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/18779#discussion_r131308421 --- Diff: sql/core/src/test/resources/sql-tests/inputs/group-by-ordinal.sql --- @@ -52,8 +52,19 @@ select count(a), a from (select 1 as a) tmp group by 2 having a > 0; -- mixed cases: group-by ordinals and aliases select a, a AS k, count(b) from data group by k, 1; --- turn of group by ordinal +-- turn off group by ordinal set spark.sql.groupByOrdinal=false; -- can now group by negative literal select sum(b) from data group by -1; + +-- SPARK-21580 ints in aggregation expressions are taken as group-by ordinal +select 4, b from data group by 1, 2; + +set spark.sql.groupByOrdinal=true; + +select 4, b from data group by 1, 2; + +select 3, 4, sum(b) from data group by 1, 2; --- End diff -- Except this line, does this PR fix any other queries?
--- 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