A column chunk is a run of pages: at most one dictionary page first, then data pages.
Each page is a Thrift PageHeader (compact protocol) followed by the page
data. This page follows
parquet.thrift
and Encodings.md
in the parquet-format repository, read 2026-11-13 (with its README, BloomFilter.md and
Compression.md). Where the chunks are is in the
file metadata.
PageHeader
| ID | Field | Meaning |
|---|---|---|
| 1 | type | 0 DATA_PAGE, 1 INDEX_PAGE (its header is marked “TODO” in the schema), 2 DICTIONARY_PAGE, 3 DATA_PAGE_V2. |
| 2 | uncompressed_page_size | Bytes after decompression, not counting the header. |
| 3 | compressed_page_size | Bytes stored after the header. |
| 4 | crc | Optional standard CRC-32 (polynomial 04C11DB7) of the page as written, after compression and encryption, not counting the header. |
| 5 | data_page_header | For type 0: 1 num_values, 2 encoding, 3 definition_level_encoding, 4 repetition_level_encoding, 5 statistics. |
| 6 | index_page_header | Empty. |
| 7 | dictionary_page_header | 1 num_values, 2 encoding (PLAIN), 3 is_sorted. |
| 8 | data_page_header_v2 | 1 num_values, 2 num_nulls, 3 num_rows, 4 encoding, 5 definition_levels_byte_length, 6 repetition_levels_byte_length, 7 is_compressed (default true), 8 statistics. |
Data page layouts
- Version 1: after the page header the repetition levels, the
definition levels and the encoded values are written back to back with no padding;
uncompressed_page_sizecovers all three together. The values are always present; levels are present only as the schema needs them. Each RLE level block starts with its 4-byte little-endian length (and so do RLE-encoded boolean values; dictionary indices do not). - Version 2: repetition levels, then definition levels, both
uncompressed, always RLE and without a length prefix (their lengths are in the header);
then the values, compressed only if
is_compressed(the section fromdefinition_levels_byte_length + repetition_levels_byte_lengthtocompressed_page_sizeis compressed with the column’s codec; missing means compressed). Boolean RLE values keep the length prefix. The number of non-null values isnum_values − num_nulls. Rows must not be split across pages.
Page rules from the schema and README: at most one dictionary page per chunk, and it is
placed first when the chunk is partly or completely dictionary encoded. With an OffsetIndex
a v1 data page must also begin at a row boundary (repetition level 0), otherwise pages may
start within a row. num_values counts nulls. The PageHeader’s compressed size is of
the compressed and possibly encrypted page, not counting the header. The CRC may be set on
every page type, is computed over the page as written (after compression and encryption,
for v1 pages the repetition levels, definition levels and values together) and excludes the
header; it is an i32 field. Additional page types can be added and skipped safely.
Pages are conceptually indivisible for compression and encoding; a column chunk is
contiguous, and its pages share a header format so readers can skip pages. The README’s
recommended sizes (row groups 512 MB to 1 GB, pages 8 KB) are advice, not format. The
README also says a corrupt footer loses the file, a corrupt column metadata loses that
chunk, a corrupt page header loses the rest of the chunk and corrupt page data loses that
page.
Compression of pages
From Compression.md. For every codec except the deprecated LZ4, the raw data
of a data or dictionary page is given as-is to the compression library with no extra
framing or padding; sizes are in the PageHeader. SNAPPY: the Snappy format; GZIP: RFC 1952
(not zlib or raw deflate), readers should accept pages of several members but writers should
avoid them; LZO: LZO-library compatible; BROTLI: RFC 7932;
ZSTD: RFC 8878; LZ4_RAW: the LZ4 block format;
LZ4 (deprecated): loosely LZ4 with an undocumented framing from the Hadoop library, which
writers should stop using in favour of LZ4_RAW. UNCOMPRESSED is a no-op. Where the formats are
ambiguous the reference libraries are authoritative.
Repetition and definition levels
Parquet uses the Dremel encoding with definition and repetition levels (the
README).
The maximum levels follow from the schema and set the number of bits needed to store
them. Repetition levels are not stored for non-nested columns, and definition levels
are skipped for required data. Levels use the RLE hybrid encoding;
BIT_PACKED is no longer used for them.
Encodings
| Value | Encoding | Used for |
|---|---|---|
| 0 | PLAIN | All types; see the physical types on the metadata page. |
| 2 | PLAIN_DICTIONARY | Deprecated name for dictionary encoding in format 1.0 files: dictionary page in PLAIN, indexes as in RLE_DICTIONARY. |
| 3 | RLE | The RLE and bit-packing hybrid: levels, booleans and dictionary indexes. |
| 4 | BIT_PACKED | Deprecated: levels bit-packed most significant bit first. |
| 5 | DELTA_BINARY_PACKED | INT32 and INT64. See below. |
| 6 | DELTA_LENGTH_BYTE_ARRAY | BYTE_ARRAY: all lengths with DELTA_BINARY_PACKED, then all the bytes one after another. |
| 7 | DELTA_BYTE_ARRAY | BYTE_ARRAY and FIXED_LEN_BYTE_ARRAY: lengths of the prefix shared with the previous value (DELTA_BINARY_PACKED), then the suffixes as DELTA_LENGTH_BYTE_ARRAY. |
| 8 | RLE_DICTIONARY | Indexes into the dictionary page: one byte giving the bit width, then the RLE hybrid without a length prefix. |
| 9 | BYTE_STREAM_SPLIT | FLOAT, DOUBLE, INT32, INT64, FIXED_LEN_BYTE_ARRAY: byte i of every value goes into stream i, and the streams follow one another. |
| 10 | ALP | FLOAT and DOUBLE; a preview encoding described in AlpEncoding.md, not covered here. |
Value 1 is not used.
RLE and bit-packing hybrid
A series of runs, each starting with a ULEB128 header:
- Lowest bit 0: an RLE run.
header >> 1is the count; the value follows inceil(bit width / 8)bytes. - Lowest bit 1: a bit-packed run of
(header >> 1) × 8values, packed from the least significant bit of each byte.
Example with bit width 1: 06 01 is an RLE run of three 1s;
03 B5 is one group of eight bit-packed values, 1, 0, 1, 0, 1, 1, 0, 1.
Grammar: a run is a bit-packed run (header varint((len / 8) << 1 | 1), then
the packed values) or an RLE run (header varint(len << 1), then the value in
round-up-to-next-byte(bit width) bytes). Run lengths are 1 to 231 − 1
(not required before parquet-format 2.5.0, but longer runs could not be read in practice). The
values are packed from the least significant bit of each byte, each value’s bits still in their
usual order: the numbers 0 to 7 at width 3 become 10001000 11000110 11111010. RLE is
allowed only for repetition and definition levels, dictionary indices, and booleans in data pages
(as an alternative to PLAIN). The 4-byte length of the encoded data, unsigned, is prefixed only
as the page layouts say. The deprecated BIT_PACKED encoding
(levels only) packs values back to back at a fixed width from the most significant bit, with the last
byte padded with zeros: 0 to 7 at width 3 become 00000101 00111001 01110111.
PLAIN, dictionary and the other byte encodings
- PLAIN: BOOLEAN bit-packed, least significant bit first (as the hybrid’s packing); INT32, INT64, INT96 (deprecated, 12 bytes), FLOAT and DOUBLE little-endian (FLOAT and DOUBLE IEEE); BYTE_ARRAY a 4-byte little-endian length and the bytes; FIXED_LEN_BYTE_ARRAY the bytes. Used whenever nothing better fits.
- Dictionary (
PLAIN_DICTIONARYdeprecated,RLE_DICTIONARY): a dictionary page, written first, holds the entries PLAIN-encoded; data pages hold the bit width (1 byte, at most 32) and then the indices in the RLE hybrid. If the dictionary grows too large in size or in distinct values, the encoding falls back to PLAIN. - DELTA_LENGTH_BYTE_ARRAY: the lengths DELTA_BINARY_PACKED, then the bytes
back to back. For “Hello”, “World”, “Foobar”, “ABCDEF”: DeltaEncoding(5, 5, 6, 6), then
HelloWorldFoobarABCDEF. - DELTA_BYTE_ARRAY (front compression): the prefix lengths shared with the
previous value, DELTA_BINARY_PACKED, then the suffixes as DELTA_LENGTH_BYTE_ARRAY. For “axis”,
“axle”, “babble”, “babyhood”: prefix lengths 0, 2, 0, 3; suffix lengths 4, 2, 6, 5; data
axislebabbleyhood. For FIXED_LEN_BYTE_ARRAY all lengths are still encoded. - BYTE_STREAM_SPLIT: for FLOAT (K = 4), DOUBLE (8), INT32, INT64 and
FIXED_LEN_BYTE_ARRAY, K streams of N bytes, the 0th byte of every value in
stream 0 and so on, streams concatenated, no padding, so the end of the streams is the end of the
page. Three floats
AA BB CC DD,00 11 22 33,A3 B4 C5 D6becomeAA 00 A3 BB 11 B4 CC 22 C5 DD 33 D6. It was added in 2.8 for FLOAT and DOUBLE and in 2.11 for the other types. - ALP: preview as of 2026-08-01 (the spec is stable, implementations are incomplete); see AlpEncoding.md, not covered here.
DELTA_BINARY_PACKED
- Header, all ULEB128: values per block (a multiple of 128), miniblocks per block (so that a miniblock holds a multiple of 32 values), total number of values, then the first value as a zigzag ULEB128.
- Each block: the minimum delta (zigzag ULEB128), one byte per miniblock giving its bit width, then the miniblocks: each delta minus the minimum, bit-packed as in the hybrid.
Zigzag maps signed to unsigned: 0 → 0, −1 → 1, 1 → 2, −2 → 3.
Details: the miniblock count per block is a divisor of the block size such that values per miniblock is a multiple of 32. Deltas are taken against the previous element (the first of a block against the last of the previous block, or the header’s first value). A partly filled last miniblock is padded to a full miniblock at its bit width; padding should be zero but readers must accept any bits. In the last block, the bit-width bytes of unneeded miniblocks are still present (should be zero, any value accepted) with no body bytes. Overflow wraps in two’s complement. Writers must not use more bits than PLAIN would for the type. Example 1: values 1, 2, 3, 4, 5, block size 8, 1 miniblock: header 8, 1, 5, 1; block min delta 1, bit width 0. Example 2: 7, 5, 3, 1, 2, 3, 4, 5: header 8, 1, 8, 7; block min delta −2, bit width 2, data 0, 0, 0, 3, 3, 3, 3 packed at 2 bits. (Encodings.md uses block size 8 for these examples to keep them short and says that would be invalid in practice.)
Bloom filters
From BloomFilter.md. A column chunk may have one split-block Bloom filter, at
bloom_filter_offset in its ColumnMetaData: a Thrift BloomFilterHeader
followed by the bitset. Filters are grouped by row group, columns in schema order; they sit after
all row groups before the page indexes, or between row groups.
| ID | BloomFilterHeader field | Meaning |
|---|---|---|
| 1 | numBytes (i32) | Size of the bitset in bytes. |
| 2 | algorithm | Union; 1 BLOCK = SplitBlockAlgorithm (empty struct). |
| 3 | hash | Union; 1 XXHASH = XxHash (empty struct): XXH64 with seed 0 (xxHash spec 0.1.1) of the value in its PLAIN encoding. |
| 4 | compression | Union; 1 UNCOMPRESSED (empty struct). |
The filter has z blocks (1 ≤ z < 231), each 256 bits as eight
32-bit words. For a 64-bit hash x: block index i = ((x >> 32) × z) >> 32
(64-bit arithmetic), and the low 32 bits y go to the block. The salt is eight odd
constants 0x47b6137b, 0x44974d91, 0x8824ad5b, 0xa2b7289d, 0x705495c7, 0x2df1424b,
0x9efc4947, 0x5c6bfb31; for word k the bit set is the top five bits of the low
32 bits of y × salt[k] (that is, (y × salt[k]) >> 27 in 32-bit
arithmetic). Insert sets those eight bits; check is true when all eight are set. A false-positive
rate of about 1.26% needs 10 bits per value (1024 blocks for 26,214 values); about 6 bits give 10%,
10.5 give 1%, 16.9 give 0.1%, 26.4 give 0.01% and 41 give 0.001%. For encrypted columns the header
and bitset are encrypted separately (see encryption).