DataFrameReader.parquet(*paths: str, **options: OptionalPrimitiveType) → DataFrame[source]

Loads Parquet files, returning the result as a DataFrame.

New in version 1.4.0.

Changed in version 3.4.0: Supports Spark Connect.

Other Parameters

For the extra options, refer to Data Source Option for the version you use.


Write a DataFrame into a Parquet file and read it back.

>>> import tempfile
>>> with tempfile.TemporaryDirectory() as d:
...     # Write a DataFrame into a Parquet file
...     spark.createDataFrame(
...         [{"age": 100, "name": "Hyukjin Kwon"}]
...     ).write.mode("overwrite").format("parquet").save(d)
...     # Read the Parquet file as a DataFrame.
|age|        name|
|100|Hyukjin Kwon|