peter-toth commented on code in PR #54330:
URL: https://github.com/apache/spark/pull/54330#discussion_r2890392490


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala:
##########
@@ -64,7 +63,17 @@ case class EnsureRequirements(
     // Ensure that the operator's children satisfy their output distribution 
requirements.
     var children = originalChildren.zip(requiredChildDistributions).map {
       case (child, distribution) if 
child.outputPartitioning.satisfies(distribution) =>
-        ensureOrdering(child, distribution)
+        distribution match {
+          case o: OrderedDistribution =>
+            ensureOrdering(child, child.outputPartitioning, o)
+          case _ => child
+        }
+      case (c @ GroupedPartitions(p), distribution) if 
p.satisfies(distribution) =>

Review Comment:
   This is refactored in 
https://github.com/apache/spark/pull/54330/commits/326915bda8917f0b9f81a9fe9e1e8426edbfe95d,
 now we don't compute the distinct set of keys so as to decide if a 
`KeyedPartitioning` can satisfy a distribution.
   As `KeyedPartitioning` is a special partitioning (not just becuase of this 
refactor PR) I elaborated on what `KeyedPartitioning.satisfies()` actually 
means.



-- 
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