cloud-fan commented on a change in pull request #31012:
URL: https://github.com/apache/spark/pull/31012#discussion_r564588100
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -418,7 +418,7 @@ object RemoveRedundantAliases extends Rule[LogicalPlan] {
// If the alias name is different from attribute name, we can't strip it
either, or we
// may accidentally change the output schema name of the root plan.
case a @ Alias(attr: Attribute, name)
- if a.metadata == Metadata.empty &&
+ if (a.metadata == Metadata.empty || a.metadata == attr.metadata) &&
Review comment:
This is the only non-testing change in this PR, but it's very minor and
obvious.
----------------------------------------------------------------
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]