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 2021/07/06 04:33:54 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects
cloud-fan commented on a change in pull request #33222:
URL: https://github.com/apache/spark/pull/33222#discussion_r664228339
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/RemoveRedundantProjects.scala
##########
@@ -48,7 +48,7 @@ object RemoveRedundantProjects extends Rule[SparkPlan] {
private def removeProject(plan: SparkPlan, requireOrdering: Boolean): SparkPlan = {
plan match {
case p @ ProjectExec(_, child) =>
- if (isRedundant(p, child, requireOrdering)) {
+ if (isRedundant(p, child, requireOrdering) && canRemove(p, child)) {
val newPlan = removeProject(child, requireOrdering)
newPlan.setLogicalLink(child.logicalLink.get)
Review comment:
This looks risky. It makes it hard to reason about the mapping between physical and logical plans.
--
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: reviews-unsubscribe@spark.apache.org
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