cloud-fan commented on code in PR #37334:
URL: https://github.com/apache/spark/pull/37334#discussion_r934331760


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -559,6 +561,34 @@ object RemoveRedundantAliases extends Rule[LogicalPlan] {
         })
         Join(newLeft, newRight, joinType, newCondition, hint)
 
+      case _: Union =>
+        var first = true
+        plan.mapChildren { child =>
+          if (first) {
+            first = false
+            child match {
+              case p: Project =>
+                var passThroughAttributes =
+                  AttributeSet(p.projectList.filter(_.isInstanceOf[Attribute]))

Review Comment:
   or we should always guarantee it: the plan looks quite weird if a plan node 
has output columns with conflicting expr IDs.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -559,6 +561,34 @@ object RemoveRedundantAliases extends Rule[LogicalPlan] {
         })
         Join(newLeft, newRight, joinType, newCondition, hint)
 
+      case _: Union =>
+        var first = true
+        plan.mapChildren { child =>
+          if (first) {
+            first = false
+            child match {
+              case p: Project =>
+                var passThroughAttributes =
+                  AttributeSet(p.projectList.filter(_.isInstanceOf[Attribute]))

Review Comment:
   or we should always guarantee it. the plan looks quite weird if a plan node 
has output columns with conflicting expr IDs.



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

Reply via email to