maropu commented on a change in pull request #30212: URL: https://github.com/apache/spark/pull/30212#discussion_r531396840
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ########## @@ -611,14 +609,15 @@ class Analyzer(override val catalogManager: CatalogManager) val aggForResolving = h.child match { // For CUBE/ROLLUP expressions, to avoid resolving repeatedly, here we delete them from // groupingExpressions for condition resolving. - case a @ Aggregate(Seq(c @ Cube(groupByExprs)), _, _) => - a.copy(groupingExpressions = groupByExprs) - case a @ Aggregate(Seq(r @ Rollup(groupByExprs)), _, _) => - a.copy(groupingExpressions = groupByExprs) - case g: GroupingSets => - Aggregate( - getFinalGroupByExpressions(g.selectedGroupByExprs, g.groupByExprs), - g.aggregations, g.child) + case a @ Aggregate(Seq(c @ Cube(_)), _, _) => Review comment: Could you add `groupingSets` in `GroupingSet` and then merge the three entries into one like this? ``` case a @ Aggregate(Seq(c: GroupingSet), _, _) => a.copy(groupingExpressions = getFinalGroupByExpressions(c.groupingSets, c.groupByExprs)) ``` ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org