Github user adrian-wang commented on a diff in the pull request:
https://github.com/apache/spark/pull/5208#discussion_r28302153
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/Exchange.scala ---
@@ -168,14 +190,16 @@ private[sql] case class AddExchange(sqlContext:
SQLContext) extends Rule[SparkPl
// At least one child does not satisfies its required data
distribution or
// at least one child's outputPartitioning is not compatible with
another child's
// outputPartitioning. In this case, we need to add Exchange
operators.
- val repartitionedChildren =
operator.requiredChildDistribution.zip(operator.children).map {
- case (AllTuples, child) =>
+ val repartitionedChildren = operator.requiredChildDistribution.zip(
+ operator.children.zip(operator.requiredChildOrdering)
+ ).map {
+ case (AllTuples, (child, _)) =>
addExchangeIfNecessary(SinglePartition, child)
- case (ClusteredDistribution(clustering), child) =>
- addExchangeIfNecessary(HashPartitioning(clustering,
numPartitions), child)
- case (OrderedDistribution(ordering), child) =>
+ case (ClusteredDistribution(clustering), (child, rowOrdering)) =>
+ addExchangeIfNecessary(HashPartitioning(clustering,
numPartitions), child, rowOrdering)
+ case (OrderedDistribution(ordering), (child, _)) =>
--- End diff --
For now we still can use `None` here to match.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]