Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19573#discussion_r147344912
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala 
---
    @@ -1497,6 +1497,27 @@ class SQLQuerySuite extends QueryTest with 
SQLTestUtils with TestHiveSingleton {
         }
       }
     
    +  test("select grouping__id from subquery.") {
    +    checkAnswer(
    +      sql(
    +        """
    +          |SELECT cnt, k2, k3, grouping__id
    +          |FROM
    +          |  (SELECT count(*) as cnt, k2, k3, grouping__id
    --- End diff --
    
    ```
    SELECT cnt, k2, k3, alias_grouping__id
    FROM
      (SELECT count(*) as cnt, k2, k3, grouping__id as alias_grouping__id
      FROM (SELECT key, key%2 as k2 , key%3 as k3 FROM src) t1
      GROUP BY k2, k3
      GROUPING SETS(k2, k3)) t2
    ORDER BY alias_grouping__id, k2, k3
    ```
    This is the workaround.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to