Skip to content

Commit fee65c4

Browse files
committed
Further refinement to comments / reasoning
1 parent 642b0bb commit fee65c4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/Exchange.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,13 @@ private[sql] case class EnsureRequirements(sqlContext: SQLContext) extends Rule[
257257
// A pre-condition of ensureDistributionAndOrdering is that joins' children have compatible
258258
// partitionings. Thus, we only need to check whether the output partitionings satisfy
259259
// the required distribution. In the case where the children are all compatible, then they
260-
// will either all satisfy the required distribution or will all fail to satisfy it:, since
261-
// (A.guarantees(B) && B.satisfies(C)) => A.satisfies(C).
260+
// will either all satisfy the required distribution or will all fail to satisfy it, since
261+
// A.guarantees(B) implies that A and B satisfy the same set of distributions.
262262
// Therefore, if all children are compatible then either all or none of them will shuffled to
263263
// ensure that the distribution requirements are met.
264+
//
265+
// Note that this reasoning implicitly assumes that operators which require compatible
266+
// child partitionings have equivalent required distributions for those children.
264267
if (child.outputPartitioning.satisfies(requiredDistribution)) {
265268
child
266269
} else {

0 commit comments

Comments
 (0)