pyspark.sql.DataFrame.tail

DataFrame.tail(num: int) → List[pyspark.sql.types.Row]

Returns the last num rows as a list of Row.

Running tail requires moving data into the application’s driver process, and doing so with a very large num can crash the driver process with OutOfMemoryError.

Examples

>>> df.tail(1)
[Row(age=5, name='Bob')]