Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/8030#discussion_r36660344
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala ---
@@ -312,7 +312,11 @@ private[sql] abstract class SparkStrategies extends
QueryPlanner[SparkPlan] {
throw new IllegalStateException(
"logical distinct operator should have been replaced by
aggregate in the optimizer")
case logical.Repartition(numPartitions, shuffle, child) =>
- execution.Repartition(numPartitions, shuffle, planLater(child)) ::
Nil
+ if (shuffle) {
+ execution.Exchange(HashPartitioning(child.output,
numPartitions), planLater(child)) :: Nil
--- End diff --
`Repartition` declared its `outputPartitioning` differently than `Exchange`:
```scala
override def outputPartitioning: Partitioning = {
if (numPartitions == 1) SinglePartition
else UnknownPartitioning(numPartitions)
}
```
This should be fine, though: in `Exchange`, we'll end up declaring the
output with a `HashPartitioning` with the target number of partitions, but
thanks to my recent Exchange refactoring patch `SinglePartition` should now be
compatible with / guaranteed by any partitioning that produces a single
partition.
---
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]