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

Add getNumPartitions() method to PySpark RDDs

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.9.0
    • 1.1.0
    • PySpark
    • None

    Description

      In Spark, you can do this:

      // Scala
      val a = sc.parallelize(List(1, 2, 3, 4), 4)
      a.partitions.size
      

      Please make this possible in PySpark too.

      The work-around available is quite simple:

      # Python
      a = sc.parallelize([1, 2, 3, 4], 4)
      a._jrdd.splits().size()
      

      Attachments

        Activity

          People

            shashmi Syed A. Hashmi
            nchammas Nicholas Chammas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: