Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-15512

repartition(0) should raise IllegalArgumentException.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • Spark Core
    • None

    Description

      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*

      repartition(0)
      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()
      

      *After*

      repartition(0)
      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.
      ...
      

      Attachments

        Issue Links

          Activity

            People

              dongjoon Dongjoon Hyun
              dongjoon Dongjoon Hyun
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: