Skip to main content

Apache Parquet

At a glance
  • Problem solved: read less data and compress better for analytics, with columnar storage that also handles nested data.
  • Era: announced on 13 March 2013, version 1.0 on 30 July 2013; Apache Incubator in May 2014, top-level project in April 2015.
  • Created by: engineers from Twitter (Julien Le Dem, Dmitriy Ryaboy, Jonathan Coveney) and Cloudera (Nong Li, Marcel Kornacker, Todd Lipcon), joined by Criteo.
  • Category: columnar file format.

Historical context​

Analytical queries often read only a few columns of very wide tables. Yet row-by-row storage forces reading everything and compresses heterogeneous values poorly. In 2010, Google's Dremel paper shows that by combining execution trees and columnar storage, tables of a trillion rows can be aggregated in seconds. But Dremel is internal to Google.

In the Hadoop ecosystem, Cloudera is preparing Impala and testing Trevni, a columnar format from the Avro project. After the Impala beta and a joint evaluation with Twitter, the two companies decide to go further. On 13 March 2013, they announce Parquet, a columnar format independent of any engine, data model or language. Real-world data is often nested: at Twitter, one common internal dataset has a schema seven levels deep, with over 80 leaf fields. Parquet therefore adopts the nested encoding described in Dremel.

Version 1.0 ships on 30 July 2013 with 18 contributors (Twitter, Cloudera, Criteo, Berkeley's AMPLab, Stripe...) and integrations with Hive, Pig, Cascading and Impala. At Twitter, large datasets shrink by a third. The project enters the Apache Incubator on 20 May 2014 and graduates on 22 April 2015: Netflix then stores more than 7 PB of its 10+ PB warehouse in it, and the press release already lists Hive, Impala, Drill, Presto and Spark SQL among the engines that read it. Table formats such as Iceberg later adopt it as a data file format.

Key idea​

Store values column by column: an engine skips unneeded columns, compresses homogeneous values better and applies type-specific encodings. For nested data (lists, structs), Parquet stores two small integers with each value, the repetition level and the definition level, which are enough to rebuild the original record. On a flat schema with no optional field, these levels disappear entirely.

How it works​

  • Hierarchy: a file holds row groups (horizontal slices of rows); each row group holds one column chunk per column, contiguous in the file; each column chunk is split into pages, the indivisible unit of encoding and compression.
  • File footer: metadata (schema, position of each column chunk) is written after the data, for single-pass writing. The reader first reads this footer, then only the columns it needs. The file starts and ends with the magic word PAR1.
  • Units of parallelism: the file or row group to split the work, the column chunk for I/O, the page for encoding.
  • Encodings: automatic dictionary, hybrid bit packing and RLE, then per-column compression. Encoding and compression are kept separate so that engines can work directly on encoded data.
  • Statistics: min and max per column chunk and per page; the page index lets readers skip whole pages without reading their headers.
  • Recommended settings: row groups of 512 MB to 1 GB, 8 KB pages.
PAR1
Row group 1: [column A, chunk 1] [column B, chunk 1] ...
Row group 2: [column A, chunk 2] [column B, chunk 2] ...
File metadata (schema, offsets, statistics)
Metadata length (4 bytes)
PAR1

By the numbers​

FigureContextSource
7 levels, 80 leavesNested schema of a common dataset at Twitter (2013)Twitter blog, Parquet 1.0
18Contributors to version 1.0, from several organizations (2013)Twitter blog, Parquet 1.0
1/3Size reduction of large datasets at Twitter (2013)Twitter blog, Sept. 2013
7 PB out of 10+ PBShare of the Netflix warehouse stored as Parquet (2015)ASF press release 2015
512 MB to 1 GBRecommended row group sizeParquet documentation
8 KBRecommended page sizeParquet documentation

Milestones​

  • 2010: Google's Dremel paper, source of the nested encoding.
  • 13 March 2013: Parquet announced by Cloudera and Twitter; preview in Impala 0.7.
  • 30 July 2013: Parquet 1.0.
  • 11 September 2013: Twitter publishes "Dremel made simple with Parquet".
  • 20 May 2014: enters the Apache Incubator.
  • 22 April 2015: Apache top-level project (announced on 27 April).
  • Today: Java (parquet-java, formerly parquet-mr), C++, Go and Rust implementations (Arrow subprojects), and native readers in DuckDB, ClickHouse or Impala.

Did you know?​

  • Parquet replaced a first attempt. Cloudera first worked on Trevni, a columnar format from the Avro project. Feedback from the Impala beta led to a new format, hosted outside Avro so as not to favor any data model.
  • "Dremel made simple". In September 2013, Julien Le Dem published at Twitter a step-by-step explanation of repetition and definition levels, with an address book as the example: "Having implemented this model based on the paper, we decided to provide a more accessible explanation."
  • Nulls cost almost nothing. Thanks to RLE on the levels, "a sparse column with a lot of null values will compress to almost nothing".
  • Stripe from day one. At graduation, Stripe stated that its warehouse "has been built on Parquet from the beginning".

Strengths and limitations​

StrengthsLimitations
Selective column reads and page skipping through statisticsPoorly suited to row-by-row writes
Strong compression: a third smaller at Twitter (2013)Costly single-row update or delete
Native support for nested data (Dremel encoding)Large row groups need more buffering on write
Interoperable standard, independent of any engineRequires a table layer for ACID

What came next​

  • ORC, a competing columnar format born the same year on the Hive side.
  • Iceberg, Hudi and Delta Lake organize Parquet files into transactional tables.
  • Arrow for in-memory columnar representation; several Parquet implementations are Arrow subprojects.
  • Trino, Spark and DuckDB read it natively.

Sources​

To do
  • Limitations "poorly suited to row-by-row writes", "costly single-row update" and "table layer for ACID": carried over from the previous version, plausible but unsourced.
  • Origin of the name "Parquet": no source found.
  • Date when the page index was added to the specification.