viirya commented on a change in pull request #29643:
URL: https://github.com/apache/spark/pull/29643#discussion_r484525143
##########
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:
Just a question. Why we need to return the attribute mapping from old to
new? Can we just detect if the output of new plan is different to old plan,
then create the mapping inside `transformUpWithNewOutput`?
----------------------------------------------------------------
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]