[ https://issues.apache.org/jira/browse/SPARK-19601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15866709#comment-15866709 ]
Apache Spark commented on SPARK-19601: -------------------------------------- User 'gatorsmile' has created a pull request for this issue: https://github.com/apache/spark/pull/16933 > 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 > > 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: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org