AngersZhuuuu commented on a change in pull request #28490: URL: https://github.com/apache/spark/pull/28490#discussion_r434955113
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ########## @@ -506,31 +506,55 @@ class Analyzer( aggregations: Seq[NamedExpression], groupByAliases: Seq[Alias], groupingAttrs: Seq[Expression], - gid: Attribute): Seq[NamedExpression] = aggregations.map { - // collect all the found AggregateExpression, so we can check an expression is part of - // any AggregateExpression or not. - val aggsBuffer = ArrayBuffer[Expression]() - // Returns whether the expression belongs to any expressions in `aggsBuffer` or not. - def isPartOfAggregation(e: Expression): Boolean = { - aggsBuffer.exists(a => a.find(_ eq e).isDefined) + gid: Attribute): Seq[NamedExpression] = { + val resolvedGroupByAliases = groupByAliases.map(_.transformDown { Review comment: > Based on above analysis, seems it is caused by `ResolveReferences`, instead of `ResolveGroupingAnalytics`? Can we possibly have a reproducible case without CUBE? This happened with cube when construct cube LogicalPlan. ---------------------------------------------------------------- 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