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

df.take(1) and df.limit(1).collect() perform differently in Python

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.1, 2.1.0
    • PySpark, SQL
    • None

    Description

      In PySpark, df.take(1) ends up running a single-stage job which computes only one partition of df, while df.limit(1).collect() ends up computing all partitions of df and runs a two-stage job. This difference in performance is confusing, so I think that we should generalize the fix from SPARK-10731 so that Dataset.collect() can be implemented efficiently in Python.

      Attachments

        Activity

          People

            joshrosen Josh Rosen
            joshrosen Josh Rosen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: