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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -659,30 +660,29 @@ class Analyzer(override val catalogManager: 
CatalogManager)
     // CUBE/ROLLUP/GROUPING SETS. This also replace grouping()/grouping_id() 
in resolved
     // Filter/Sort.
     def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperatorsDown {
-      case h @ UnresolvedHaving(
-          _, agg @ Aggregate(Seq(c @ Cube(groupByExprs)), 
aggregateExpressions, _))
-          if agg.childrenResolved && (groupByExprs ++ 
aggregateExpressions).forall(_.resolved) =>
+      case h @ UnresolvedHaving(_, agg @ Aggregate(Seq(c @ Cube(_)), 
aggregateExpressions, _))
+          if agg.childrenResolved && (c.groupByExprs ++ 
aggregateExpressions).forall(_.resolved) =>
         tryResolveHavingCondition(h)
-      case h @ UnresolvedHaving(
-          _, agg @ Aggregate(Seq(r @ Rollup(groupByExprs)), 
aggregateExpressions, _))
-          if agg.childrenResolved && (groupByExprs ++ 
aggregateExpressions).forall(_.resolved) =>
+      case h @ UnresolvedHaving(_, agg @ Aggregate(Seq(r @ Rollup(_)), 
aggregateExpressions, _))

Review comment:
       ditto

##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -659,30 +660,29 @@ class Analyzer(override val catalogManager: 
CatalogManager)
     // CUBE/ROLLUP/GROUPING SETS. This also replace grouping()/grouping_id() 
in resolved
     // Filter/Sort.
     def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperatorsDown {
-      case h @ UnresolvedHaving(
-          _, agg @ Aggregate(Seq(c @ Cube(groupByExprs)), 
aggregateExpressions, _))
-          if agg.childrenResolved && (groupByExprs ++ 
aggregateExpressions).forall(_.resolved) =>
+      case h @ UnresolvedHaving(_, agg @ Aggregate(Seq(c @ Cube(_)), 
aggregateExpressions, _))
+          if agg.childrenResolved && (c.groupByExprs ++ 
aggregateExpressions).forall(_.resolved) =>
         tryResolveHavingCondition(h)
-      case h @ UnresolvedHaving(
-          _, agg @ Aggregate(Seq(r @ Rollup(groupByExprs)), 
aggregateExpressions, _))
-          if agg.childrenResolved && (groupByExprs ++ 
aggregateExpressions).forall(_.resolved) =>
+      case h @ UnresolvedHaving(_, agg @ Aggregate(Seq(r @ Rollup(_)), 
aggregateExpressions, _))
+          if agg.childrenResolved && (r.groupByExprs ++ 
aggregateExpressions).forall(_.resolved) =>
         tryResolveHavingCondition(h)
-      case h @ UnresolvedHaving(_, g: GroupingSets)
-          if g.childrenResolved && g.expressions.forall(_.resolved) =>
+      case h @ UnresolvedHaving(
+        _, agg @ Aggregate(Seq(gs @ GroupingSets(_, _)), aggregateExpressions, 
_))

Review comment:
       ditto




----------------------------------------------------------------
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

Reply via email to