# Parquet: how a file is laid out

> Learn how an Apache Parquet file is organized on disk—from opening PAR1 to row groups, column chunks, pages and the trailing footer—and why readers start at the end.

Page: https://structure.fi/guides/parquet-file-layout/

Apache Parquet is an open binary file format for storing large tables—such as historical trades, order-book snapshots, and backtest datasets—**column by column** instead of row by row. Analysts, data engineers, and trading desks use it because a query that needs only `ts_recv`, `symbol`, and `price` out of fifty columns can read just those three columns from disk, and grouping identical types together lets [encodings and compression](https://structure.fi/guides/parquet-encodings-and-compression/) shrink files dramatically.

Unlike streaming wire formats ([how a binary message is put together](https://structure.fi/guides/binary-message/)), a Parquet file puts its directory—the **footer**—at the very end so writers can stream data out in one pass and readers can jump straight to the tail to locate only the bytes they need. This page walks through every part of a `.parquet` file from opening `PAR1` to closing `PAR1`, how readers navigate it, and what to check when inspecting a file's layout.

## The trades sample in the Market Data Visualizer

The bundled trades sample holds 2,317 rows across 10 columns in 5 row groups (84,875 bytes total). Open its **File layout** view to see the whole file top to bottom: opening `PAR1`, five row groups (`rg0`–`rg4`) of column chunks, the 5,807-byte footer (`79060..84867`), its 4-byte length, and closing `PAR1`.

[Open the trades sample's byte layout](https://structure.fi/tools/market-data-visualizer/app/#open?sample=trades&place=bytes&guide=parquet-file-layout&section=block-4)

## How a reader walks a Parquet file

1. **Verify `PAR1` at both ends.** Both the first 4 bytes and last 4 bytes must be the ASCII magic number `PAR1` ([framing](https://structure.fi/guides/binary-message/#framing)). A missing trailing `PAR1` catches truncated uploads or copies immediately.
2. **Read the footer length and footer.** The 4 bytes right before the final `PAR1` are a [little-endian](https://structure.fi/guides/binary-message/#parquet) integer giving the footer's byte size. Reading those last 8 bytes lets the reader seek directly to the footer.
3. **Locate row groups and column chunks.** The footer lists every row group and every column chunk's file offset, byte size, codec, encodings, and min/max/null statistics—so the reader skips unneeded columns and non-matching row groups without reading them.
4. **Decompress and decode pages.** Only the matching column chunks' pages are read from disk.

## The magic number

`PAR1` (4 ASCII bytes) at byte 0 and at the last 4 bytes identifies the format and confirms the file was written completely.

## Row groups

A **row group** is a horizontal slice of rows containing all columns for that slice, written one after another. Larger row groups compress better; smaller row groups let queries skip more data when filtering on statistics.

## Column chunks

Within a row group, one column's values form a single contiguous **column chunk** with one [physical type](#physical-and-logical-types), one compression codec, and one or more encodings. Reading only `price` reads just the `price` chunk of each row group.

## Pages

Each column chunk is a sequence of **pages**—the unit of compression and decoding. Every page starts with an uncompressed header giving its type, uncompressed/compressed sizes, and value count:

- **Dictionary page** (at most one, always first): holds distinct values referenced by index from data pages.
- **Data page**: holds encoded values plus repetition and definition levels (null and list structure).
- **Index page**: reserved by the spec; rarely written.

See [Parquet encodings and compression](https://structure.fi/guides/parquet-encodings-and-compression/) for how values are encoded and compressed inside pages.

## The footer

Encoded in Apache Thrift compact protocol, the footer holds everything needed to navigate the file:

- Format `version`, total row count, and `created_by`.
- **Schema**: tree of fields stored as a flat list, each with physical type, optional logical type, and repetition (`required`, `optional`, `repeated`).
- **Row groups and column chunks**: row counts, byte offsets, codecs, encodings, sizes, and usually per-chunk statistics (min, max, null count).
- **Key-value metadata**: optional pairs where tools like Arrow store their own schema.

[Open the price column's footer entries](https://structure.fi/tools/market-data-visualizer/app/#open?sample=trades&node=price&place=detail&guide=parquet-file-layout&section=block-29)

## Physical and logical types

Every column has a **physical type** describing how bytes are stored (`BOOLEAN`, `INT32`, `INT64`, `FLOAT`, `DOUBLE`, `BYTE_ARRAY`, `FIXED_LEN_BYTE_ARRAY`, plus deprecated `INT96`) and an optional **logical type** describing how to interpret them (such as `STRING`, `TIMESTAMP`, or `DECIMAL`).

In the trades sample, `price` is an `INT64` interpreted as `DECIMAL(18,9)` and `symbol` is a `BYTE_ARRAY` interpreted as `STRING` ([decimals in Parquet](https://structure.fi/guides/prices-and-times-as-integers/#decimals-in-parquet)). Because `price` is `optional`, it carries definition levels (`max_definition_level` = 1) to mark nulls without storing null values, whereas required `symbol` has `max_definition_level` = 0 ([null values in Parquet](https://structure.fi/guides/binary-message/#parquet)).

## Page indexes and bloom filters

Between the last row group and the footer, newer writers can append a **column index** (min/max per page), an **offset index** (start offset of each page), and **bloom filters** (fast membership tests), allowing readers to skip individual pages rather than whole row groups.

## What to check when inspecting a file

- Confirm row groups are neither tiny (hurts compression) nor huge (prevents pruning) and that time ranges do not overlap across row groups.
- Check that prices use `DECIMAL` (not `FLOAT`/`DOUBLE`) and timestamps carry UTC adjustment where expected.
- For a hands-on walkthrough of every pane of the app on this file, see [inspect a Parquet file in the browser](https://structure.fi/tools/market-data-visualizer/guides/inspect-parquet-file.md).

## Sources

- https://parquet.apache.org/docs/file-format/
- https://parquet.apache.org/docs/file-format/metadata/
- https://github.com/apache/parquet-format

Reviewed by Structure on 2026-11-24. Last changed 2026-11-26.
