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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/grouping.scala
##########
@@ -79,6 +79,29 @@ case class Cube(groupByExprs: Seq[Expression]) extends 
GroupingSet {}
 // scalastyle:on line.size.limit line.contains.tab
 case class Rollup(groupByExprs: Seq[Expression]) extends GroupingSet {}
 
+// scalastyle:off line.size.limit line.contains.tab
+@ExpressionDescription(
+  usage = """
+    _FUNC_(([col1[, col2 ..]])*) - create a multi-dimensional grouping sets 
using the specified columns
+      so that we can run aggregation on them.
+  """,
+  examples = """
+    Examples:
+      > SELECT name, age, count(*) FROM VALUES (2, 'Alice'), (5, 'Bob') 
people(age, name) GROUP BY _FUNC_(name, age, (name, age));
+        Bob 5 1
+        Alice 2 1
+        Alice NULL     1
+        NULL  2  2
+        Bob NULL  1
+        NULL  5 1
+  """,
+  since = "2.0.0")
+// scalastyle:on line.size.limit line.contains.tab
+case class GroupingSetsV2(selectedGroupByExprs: Seq[Seq[Expression]]) extends 
GroupingSet {

Review comment:
       > Why do we need this? We cannot just map a parsed `GROUPING SETS` into 
the existing `GroupingSets`?
   
   I want to replace origin  `GroupingSets` since it's not necessary to make it 
as a  Individual plan, we can just use expression like  CUBE/ROLLUP.
   
   By the way, with this advise 
https://github.com/apache/spark/pull/30212#discussion_r518576347,  current 
CUBE?ROLLUP need to change like this  `GroupingSetsV2` too to support 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]

Reply via email to