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 2016/05/24 21:53:12 UTC

[jira] [Commented] (SPARK-15512) repartition(0) should raise IllegalArgumentException.

    [ https://issues.apache.org/jira/browse/SPARK-15512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15299000#comment-15299000 ] 

Apache Spark commented on SPARK-15512:
--------------------------------------

User 'dongjoon-hyun' has created a pull request for this issue:
https://github.com/apache/spark/pull/13282

> repartition(0) should raise IllegalArgumentException.
> -----------------------------------------------------
>
>                 Key: SPARK-15512
>                 URL: https://issues.apache.org/jira/browse/SPARK-15512
>             Project: Spark
>          Issue Type: Bug
>            Reporter: Dongjoon Hyun
>
> Previously, SPARK-8893 added the positive partition constrains on repartition/coalesce operations in general.
> This PR adds one missing part for that and adds explicit two testcases.
> **Before**
> {code:title=repartition(0)|borderStyle=solid}
> scala> sc.parallelize(1 to 5).coalesce(0).collect()
> java.lang.IllegalArgumentException: requirement failed: Number of partitions (0) must be positive.
> ...
> scala> sc.parallelize(1 to 5).repartition(0).collect()
> res1: Array[Int] = Array()
> {code}
> **After**
> {code:title=repartition(0)|borderStyle=solid}
> scala> sc.parallelize(1 to 5).coalesce(0).collect()
> java.lang.IllegalArgumentException: requirement failed: Number of partitions (0) must be positive.
> ...
> scala> sc.parallelize(1 to 5).repartition(0).collect()
> java.lang.IllegalArgumentException: requirement failed: Number of partitions (0) must be positive.
> ...
> {code}



--
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