GitHub user jinxing64 opened a pull request: https://github.com/apache/spark/pull/19573
[SPARK-22350][SQL] select grouping__id from subquery ## What changes were proposed in this pull request? Currently, sql below will fail: ``` SELECT cnt, k2, k3, grouping__id FROM (SELECT count as cnt, k2, k3, grouping__id FROM t1 GROUP BY k2, k3 GROUPING SETS(k2, k3)) t2 ``` The use case is common in our warehouse and supported hive now. Could we support it? ## How was this patch tested? Test added You can merge this pull request into a Git repository by running: $ git pull https://github.com/jinxing64/spark SPARK-22350 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/19573.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #19573 ---- commit c0ecbeea29c39091a7c1105afaa3741e28c19286 Author: jinxing <jinxing6...@126.com> Date: 2017-10-24T13:18:56Z select grouping__id from subquery ---- --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org