You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/26 07:11:29 UTC

[GitHub] [spark] maropu commented on pull request #30144: [SPARK-33229][SQL]Support GROUP BY use Separate columns and CUBE/ROLLUP

maropu commented on pull request #30144:
URL: https://github.com/apache/spark/pull/30144#issuecomment-716353950


   I'm not familiar with this mixed case, so I just want to know a whole picture of this feature first. The other systems support this feature? And, how about the other mixed cases as follows?
   ```
   postgres=# create table t(a int, b int, c int, v int);
   postgres=# insert into t values (1, 1, 1, 1);
   postgres=# select a, b, c, sum(v) from t group by rollup(a, b), cube(b, c);
    a | b | c | sum 
   ---+---+---+-----
      |   |   |   1
    1 |   | 1 |   1
    1 |   |   |   1
    1 | 1 | 1 |   1
    1 | 1 | 1 |   1
    1 | 1 | 1 |   1
      | 1 | 1 |   1
      |   | 1 |   1
    1 | 1 |   |   1
    1 | 1 |   |   1
    1 | 1 |   |   1
      | 1 |   |   1
   (12 rows)
   
   postgres=# select a, b, c, sum(v) from t group by rollup(a, b), cube(b, c), grouping sets(a, c);
    a | b | c | sum 
   ---+---+---+-----
    1 | 1 |   |   1
    1 | 1 |   |   1
    1 | 1 |   |   1
    1 | 1 |   |   1
    1 |   |   |   1
    1 |   |   |   1
    1 | 1 | 1 |   1
    1 | 1 | 1 |   1
    1 | 1 | 1 |   1
    1 | 1 | 1 |   1
    1 | 1 | 1 |   1
    1 | 1 | 1 |   1
    1 | 1 | 1 |   1
    1 | 1 | 1 |   1
    1 | 1 | 1 |   1
    1 | 1 | 1 |   1
      | 1 | 1 |   1
      | 1 | 1 |   1
      |   | 1 |   1
      |   | 1 |   1
    1 |   | 1 |   1
    1 |   | 1 |   1
    1 |   | 1 |   1
    1 |   | 1 |   1
   (24 rows)
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org