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/08/05 11:59:41 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #33603: [SPARK-36376][SQL] Collapse repartitions if there is a project between them
cloud-fan commented on a change in pull request #33603:
URL: https://github.com/apache/spark/pull/33603#discussion_r683378320
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -913,10 +913,17 @@ object CollapseRepartition extends Rule[LogicalPlan] {
case (false, true) => if (r.numPartitions >= child.numPartitions) child else r
case _ => r.copy(child = child.child)
}
+ case r @ Repartition(_, _, p @ Project(_, child: RepartitionOperation)) =>
Review comment:
Is `Project` the only node to deal with? how about `Filter`/`Union`?
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -913,10 +913,17 @@ object CollapseRepartition extends Rule[LogicalPlan] {
case (false, true) => if (r.numPartitions >= child.numPartitions) child else r
case _ => r.copy(child = child.child)
}
+ case r @ Repartition(_, _, p @ Project(_, child: RepartitionOperation)) =>
Review comment:
This reminds me of `EliminateSorts`
--
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