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

Improve RDD.take on small number of partitions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2.1
    • 2.3.0
    • Spark Core
    • None

    Description

      In current implementation of RDD.take, we overestimate the number of partitions we need to try by 50%:
      `(1.5 * num * partsScanned / buf.size).toInt`
      However, when the number is small, the result of `.toInt` is not what we want.
      E.g, 2.9 will become 2, which should be 3.
      Use math.Ceil fix the problem.

      Attachments

        Activity

          People

            Gengliang.Wang Gengliang Wang
            Gengliang.Wang Gengliang Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: