viirya commented on a change in pull request #29089:
URL: https://github.com/apache/spark/pull/29089#discussion_r454009047
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -981,6 +982,10 @@ object EliminateSorts extends Rule[LogicalPlan] {
j.copy(left = recursiveRemoveSort(originLeft), right =
recursiveRemoveSort(originRight))
case g @ Aggregate(_, aggs, originChild) if isOrderIrrelevantAggs(aggs) =>
g.copy(child = recursiveRemoveSort(originChild))
+ case r: RepartitionByExpression =>
+ r.copy(child = recursiveRemoveSort(r.child))
Review comment:
Non-deterministic expressions could have status and row-order sensitive.
In `EliminateSorts` we also only remove Sort for Project and Filter where
projection list and condition are deterministic.
----------------------------------------------------------------
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]