AngersZhuuuu commented on a change in pull request #28490:
URL: https://github.com/apache/spark/pull/28490#discussion_r480129864
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -3383,6 +3419,25 @@ object CleanupAliases extends Rule[LogicalPlan] {
}
}
+ // For struct field, it will be resolve as Alias(GetStructField, name),
+ // In Aggregate/GroupingSets this behavior will cause the same struct fields
+ // in aggExprs/groupExprs/selectedGroupByExprs be treated as different ones
due to different
+ // ExprIds in Alias, and stops us finding the grouping expressions in
aggExprs. Here we
+ // will use this method to remove Alias with different ExprId of
GetStructField
+ // in groupByAlias/selectedGroupByExprs and aggregateExpressions
+ def trimStructFieldAlias(e: Expression): Expression = {
Review comment:
> It's only called in `ResolveReferences`, let's define it there.
Ok
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]