AngersZhuuuu commented on a change in pull request #32201: URL: https://github.com/apache/spark/pull/32201#discussion_r616312038
########## File path: sql/core/src/test/resources/sql-tests/results/ansi/group-analytics.sql.out ########## @@ -1067,3 +1067,227 @@ struct<a:int,b:int,count(1):bigint> 3 NULL 2 3 NULL 2 3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(ROLLUP(a, b)) Review comment: Thanks for your double check. ########## File path: sql/core/src/test/resources/sql-tests/inputs/group-analytics.sql ########## @@ -80,3 +80,14 @@ SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS((a, b), (a), ()); SELECT a, b, count(1) FROM testData GROUP BY a, CUBE(a, b), GROUPING SETS((a, b), (a), ()); SELECT a, b, count(1) FROM testData GROUP BY a, CUBE(a, b), ROLLUP(a, b), GROUPING SETS((a, b), (a), ()); +-- Support use CUBE/ROLLUP/GROUPING SETS in GROUPING SETS Review comment: done ########## File path: docs/sql-ref-syntax-qry-select-groupby.md ########## @@ -95,9 +95,12 @@ aggregate_name ( [ DISTINCT ] expression [ , ... ] ) [ FILTER ( WHERE boolean_ex (product, warehouse, location), (warehouse), (product), (warehouse, product), ())`. The N elements of a `CUBE` specification results in 2^N `GROUPING SETS`. -* **Mixed Grouping Analytics** +* **Mixed/Nested Grouping Analytics** - A GROUP BY clause can include multiple `group_expression`s and multiple `CUBE|ROLLUP|GROUPING SETS`s. + A GROUP BY clause can include multiple `group_expression`s and multiple `CUBE|ROLLUP|GROUPING SETS`s. + Also `GROUPING SETS` can have nested `CUBE|ROLLUP|GROUPING SETS` clauses, e.g. Review comment: done -- 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