cloud-fan commented on a change in pull request #29643:
URL: https://github.com/apache/spark/pull/29643#discussion_r484626924



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala
##########
@@ -168,6 +170,89 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]] 
extends TreeNode[PlanT
     }.toSeq
   }
 
+  /**
+   * A variant of `transformUp`, which takes care of the case that the rule 
replaces a plan node
+   * with a new one that has different output expr IDs, by updating the 
attribute references in
+   * the parent nodes accordingly.
+   *
+   * @param rule the function to transform plan nodes, and return new nodes 
with attributes mapping

Review comment:
       Because that's too hard. For example, `WidenSetOperationTypes` returns 
attribute mapping according to the replaced children, not itself, because 
itself may not be resolved yet. While for self-join dedup, we return attribute 
mapping according to the current node.




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

Reply via email to