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: [email protected]

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