You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2015/07/08 12:53:04 UTC
[jira] [Commented] (SPARK-8893) Require positive partition counts
in RDD.repartition
[ https://issues.apache.org/jira/browse/SPARK-8893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14618402#comment-14618402 ]
Apache Spark commented on SPARK-8893:
-------------------------------------
User 'darabos' has created a pull request for this issue:
https://github.com/apache/spark/pull/7285
> Require positive partition counts in RDD.repartition
> ----------------------------------------------------
>
> Key: SPARK-8893
> URL: https://issues.apache.org/jira/browse/SPARK-8893
> Project: Spark
> Issue Type: Improvement
> Affects Versions: 1.4.0
> Reporter: Daniel Darabos
> Priority: Trivial
>
> What does {{sc.parallelize(1 to 3).repartition(p).collect}} return? I would expect {{Array(1, 2, 3)}} regardless of {{p}}. But if {{p}} < 1, it returns {{Array()}}. I think instead it should throw an {{IllegalArgumentException}}.
> I think the case is pretty clear for {{p}} < 0. But the behavior for {{p}} = 0 is also error prone. In fact that's how I found this strange behavior. I used {{rdd.repartition(a/b)}} with positive {{a}} and {{b}}, but {{a/b}} was rounded down to zero and the results surprised me. I'd prefer an exception instead of unexpected (corrupt) results.
> I'm happy to send a pull request for this.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org