Dongjoon Hyun created SPARK-15512: ------------------------------------- Summary: 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-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org