You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/09/07 17:07:10 UTC
[GitHub] [spark] viirya commented on a change in pull request #29643: [SPARK-32638][SQL][FOLLOWUP] Move the plan rewriting methods to QueryPlan
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org