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

Improve RDD.take on small number of partitions

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.3.0
    • Component/s: Spark Core
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: