Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/8030#discussion_r36659820
--- 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
+ } else {
+ execution.Repartition(numPartitions, shuffle, planLater(child))
:: Nil
--- End diff --
If the physical `Repartition` operator is now only used for `coalesce` then
it might make sense to just rename it to `Coalesce` and to omit the `shuffle`
parameter, always forcing it to `false.
---
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]