[ https://issues.apache.org/jira/browse/SPARK-13957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wenchen Fan updated SPARK-13957: -------------------------------- Assignee: Xiao Li > Support group by ordinal in SQL > ------------------------------- > > Key: SPARK-13957 > URL: https://issues.apache.org/jira/browse/SPARK-13957 > Project: Spark > Issue Type: Improvement > Components: SQL > Reporter: Reynold Xin > Assignee: Xiao Li > Fix For: 2.0.0 > > > This is to support order by position in SQL, e.g. > {noformat} > select c1, c2, c3, sum(*) from tbl group by by 1, 3, c4 > {noformat} > should be equivalent to > {noformat} > select c1, c2, c3, sum(*) from tbl order by c1, c3, c4 > {noformat} > We only convert integer literals (not foldable expressions). > For positions that are aggregate functions, an analysis exception should be > thrown, e.g. in postgres; > {noformat} > rxin=# select 'one', 'two', count(*) from r1 group by 1, 3; > ERROR: aggregate functions are not allowed in GROUP BY > LINE 1: select 'one', 'two', count(*) from r1 group by 1, 3; > ^ > {noformat} > This should be controlled by config option spark.sql.groupByOrdinal. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org