cloud-fan commented on a change in pull request #30144:
URL: https://github.com/apache/spark/pull/30144#discussion_r605473810
##########
File path: docs/sql-ref-syntax-qry-select-groupby.md
##########
@@ -88,6 +89,41 @@ 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`.
+* **Partial Grouping Analytics**
+
+ Partial grouping analytics means there are both `group_expression` and
`CUBE|ROLLUP|GROUPING SETS`
+ in GROUP BY clause. For example:
+ `GROUP BY warehouse, CUBE(product, location)` is equivalent to
+ `GROUP BY GROUPING SETS((warehouse, product, location), (warehouse,
product), (warehouse, location), (warehouse))`.
+ `GROUP BY warehouse, ROLLUP(product, location)` is equivalent to
+ `GROUP BY GROUPING SETS((warehouse, product, location), (warehouse,
product), (warehouse))`.
+ `GROUP BY warehouse, GROUPING SETS((product, location), (producet), ())`
is equivalent to
+ `GROUP BY GROUPING SETS((warehouse, product, location), (warehouse,
location), (warehouse))`.
+
+* **Concatenated Groupings**
+
+ Concatenated grouping analytics offer a concise way to generate useful
combinations of groupings. Groupings specified
+ with concatenated groupings yield the cross-product of groupings from each
grouping set. The cross-product
+ operation enables even a small number of concatenated groupings to
generate a large number of final groups.
+ The concatenated groupings are specified simply by listing multiple
`GROUPING SETS`, `CUBES`, and `ROLLUP`,
Review comment:
We can just say that CUBE/ROLLUP are just syntax sugar for GROUPING
SETS, then the document can just focus on GROUPING SETS.
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]