[
https://issues.apache.org/jira/browse/SPARK-19601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xiao Li resolved SPARK-19601.
-----------------------------
Resolution: Fixed
Fix Version/s: 2.2.0
> Fix CollapseRepartition rule to preserve shuffle-enabled Repartition
> --------------------------------------------------------------------
>
> Key: SPARK-19601
> URL: https://issues.apache.org/jira/browse/SPARK-19601
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 2.0.2, 2.1.0
> Reporter: Xiao Li
> Assignee: Xiao Li
> Fix For: 2.2.0
>
>
> When users use the shuffle-enabled `repartition` API, they expect the
> partition they got should be the exact number they provided, even if they
> call shuffle-disabled `coalesce` later. Currently, `CollapseRepartition` rule
> does not consider whether shuffle is enabled or not. Thus, we got the
> following unexpected result.
> {noformat}
> val df = spark.range(0, 10000, 1, 5)
> val df2 = df.repartition(10)
> assert(df2.coalesce(13).rdd.getNumPartitions == 5)
> assert(df2.coalesce(7).rdd.getNumPartitions == 5)
> assert(df2.coalesce(3).rdd.getNumPartitions == 3)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]