AngersZhuuuu commented on a change in pull request #32201:
URL: https://github.com/apache/spark/pull/32201#discussion_r618090727



##########
File path: docs/sql-ref-syntax-qry-select-groupby.md
##########
@@ -113,7 +117,10 @@ aggregate_name ( [ DISTINCT ] expression [ , ... ] ) [ 
FILTER ( WHERE boolean_ex
         (warehouse, location),
         (warehouse, size),
         (warehouse))`.
- 
+    
+    `GROUP BY GROUPING SETS(GROUPING SETS(warehouse, product), GROUPING 
SETS(location, size))` is equivalent to 
+    `GROUP BY  GROUPING SETS((warehouse, product), (location, size))`.

Review comment:
       > interesting, so nested grouping set is just syntax sugar for 
specifying a grouping set?
   
   It seems yes, the benefit is we can  write CUBE/ROLLUP in GROUPING SETS.
   since `GROUP BY GROUPING SETS((A, B), (A), (), (A, C))` can write as 
`GROUPING BY(ROLLUP(A, B), (A, C))`




-- 
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:
us...@infra.apache.org



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

Reply via email to