[NO ISSUE][DOC] Document grouping sets syntax
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
- Document grouping sets in group by clause
Change-Id: I28724daf0683c94419d41134c7c967e9958b9e5a
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/9726
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Dmitry Lychagin <dmitry.lychagin@couchbase.com>
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
diff --git a/asterixdb/asterix-doc/src/main/grammar/sqlpp.ebnf b/asterixdb/asterix-doc/src/main/grammar/sqlpp.ebnf
index 62d333ac..45d7d6e 100644
--- a/asterixdb/asterix-doc/src/main/grammar/sqlpp.ebnf
+++ b/asterixdb/asterix-doc/src/main/grammar/sqlpp.ebnf
@@ -76,12 +76,22 @@
WhereClause ::= "WHERE" Expr
-GroupByClause ::= "GROUP BY" Expr ("AS"? Identifier)? ( "," Expr ("AS"? Identifier)?)* GroupAsClause?
+GroupByClause ::= "GROUP BY" GroupingElement ("," GroupingElement)* GroupAsClause?
-HavingClause ::= "HAVING" Expr
+GroupingElement ::= GroupByExprPair
+ | ( "(" GroupByExprPair ( "," GroupByExprPair )* ")")
+ | ( "GROUPING" "SETS" "(" GroupingElement ("," GroupingElement)* ")" )
+ | ( ( "ROLLUP" | "CUBE" ) "(" OrdinaryGroupingSet ( "," OrdinaryGroupingSet )* ")" )
+ | ( "(" ")" )
+
+OrdinaryGroupingSet ::= GroupByExprPair | ( "(" GroupByExprPair ( "," GroupByExprPair )* ")")
+
+GroupByExprPair ::= Expr ("AS"? Identifier)?
GroupAsClause ::= "GROUP AS" Identifier
+HavingClause ::= "HAVING" Expr
+
Selection ::= WithClause? QueryBlock UnionOption* OrderByClause? ( LimitClause | OffsetClause )?
UnionOption ::= "UNION ALL" (QueryBlock | Subquery)
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
index 17e6339..8076140 100644
--- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
@@ -652,6 +652,14 @@
### GroupByClause
****
+### GroupingElement
+****
+
+### OrdinaryGroupingSet
+****
+
+### GroupByExprPair
+****
---