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

Tail method for spark DataFrame

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.4.0
    • None
    • PySpark
    • None

    Description

      There is a head method for spark dataframes which work fine but there doesn't seems to be tail method.

      ```
      >>> ans
      DataFrame[v1: bigint]
      >>> ans.head(3)
      [Row(v1=299443), Row(v1=299493), Row(v1=300751)]
      >>> ans.tail(3)
      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/jan/git/db-benchmark/spark/py-spark/lib/python3.6/site-packages/py
      spark/sql/dataframe.py", line 1300, in _getattr_
      "'%s' object has no attribute '%s'" % (self._class.name_, name))
      AttributeError: 'DataFrame' object has no attribute 'tail'
      ```
      I would like to feature request Tail method for spark dataframe

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jangorecki Jan Gorecki
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: