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



##########
File path: 
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
##########
@@ -601,14 +601,24 @@ aggregationClause
     ;
 
 groupByClause
-    : groupingAnalytics
+    : nestedGroupingSets
+    | groupingAnalytics
     | expression
     ;
 
+nestedGroupingSets
+    :  GROUPING SETS '(' nestedGroupingSet (',' nestedGroupingSet)* ')'

Review comment:
       > What if we have (2 or more)-nested grouping sets? `GROUPING 
SETS(GROUPING SETS(GROUPING SETS(...`? I think we need tests for it.
   
   Good catch..Just tested, PG support nested 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