You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/04/01 09:30:35 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #32022: [SPARK-34932][SQL] Ignore the groupBy expressions in GROUP BY ... GROUPING SETS

cloud-fan commented on a change in pull request #32022:
URL: https://github.com/apache/spark/pull/32022#discussion_r605511048



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
##########
@@ -914,19 +914,19 @@ class AstBuilder extends SqlBaseBaseVisitor[AnyRef] with SQLConfHelper with Logg
       selectExpressions: Seq[NamedExpression],
       query: LogicalPlan): LogicalPlan = withOrigin(ctx) {
     if (ctx.groupingExpressionsWithGroupingAnalytics.isEmpty) {
-      val groupByExpressions = expressionList(ctx.groupingExpressions)
       if (ctx.GROUPING != null) {
-        // GROUP BY .... GROUPING SETS (...)
-        // `GROUP BY warehouse, product GROUPING SETS((warehouse, producets), (warehouse))` is
-        // semantically equivalent to `GROUP BY GROUPING SETS((warehouse, produce), (warehouse))`.
-        // Under this grammar, the fields appearing in `GROUPING SETS`'s groupingSets must be a
-        // subset of the columns appearing in group by expression.
+        // GROUP BY GROUPING SETS (...)
+        if (!ctx.groupingExpressions.isEmpty) {
+          logWarning("The groupBy expressions between 'GROUP BY' and 'GROUPING SETS' will " +
+            "be ignored and this syntax is deprecated. Please use 'GROUP BY GROUPING SETS (...)' " +
+            "directly.")
+        }

Review comment:
       how is it changed?




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org