shivadarshan-devadiga commented on code in PR #60756:
URL: https://github.com/apache/spark/pull/60756#discussion_r4652422743
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -1519,8 +1519,13 @@ object PushProjectionThroughUnion extends
Rule[LogicalPlan] {
val result = e transform {
case a: Attribute => rewrites(a)
} match {
- // Make sure exprId is unique in each child of Union.
- case Alias(child, alias) => Alias(child, alias)()
+ // Make sure exprId is unique in each child of Union. The alias keeps
its explicit metadata,
+ // as in the first child, so that the CHAR types of the children stay
the same, see
+ // SetOperationCharPadding.
+ case a @ Alias(child, alias) =>
+ Alias(child, alias)(
Review Comment:
That change is reverted: with the gate only during analysis,
`PushProjectionThroughUnion` doesn't need to keep the metadata of the children
equal, so `pushToRight` is as it was before this PR.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]