Github user davies commented on a diff in the pull request: https://github.com/apache/spark/pull/11083#discussion_r52957628 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/Exchange.scala --- @@ -395,18 +395,31 @@ private[sql] case class EnsureRequirements(sqlContext: SQLContext) extends Rule[ assert(requiredChildOrderings.length == children.length) // Ensure that the operator's children satisfy their output distribution requirements: - children = children.zip(requiredChildDistributions).map { case (child, distribution) => - if (child.outputPartitioning.satisfies(distribution)) { + children = children.zip(requiredChildDistributions).map { + case (child, distribution) if child.outputPartitioning.satisfies(distribution) => child - } else { + case (child, BroadcastDistribution(m1)) => + child match { + // The child is broadcasting the same variable: keep the child. + case Broadcast(m2, _) if m1 == m2 => child --- End diff -- Should we have a `BroadcastPartitioning` as the outputPartitioning of `Broadcast`? Then can have different implementation.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org