pyspark.sql.DataFrame.collect

DataFrame.collect() → List[pyspark.sql.types.Row][source]

Returns all the records as a list of Row.

New in version 1.3.0.

Examples

>>> df.collect()
[Row(age=2, name='Alice'), Row(age=5, name='Bob')]