Skip to content

Research notes / Data integrity

Parquet checksums: a successful read is not a file integrity check

Published / Updated

A Parquet file can return a wrong value without an error even when it contains a checksum for that page. In our PyArrow 21.0.0 experiment, enabling verification detects the changed bit. But it neither requires a checksum to exist nor validates data excluded from the read.

On this page12 sections

Three independent requirements

For a page checksum to detect a change, the writer must have stored it, the reader must check it, and the operation must actually validate the affected page. Treating these as one feature hides distinct failure modes.

Parquet separates row groups into column chunks and pages, with metadata describing their structure. Selecting one column is useful precisely because the application need not decode all other columns. A readable footer and correct declared row count therefore do not establish payload integrity. [metadata]

The format supports a page CRC32 over serialized page bytes, excluding the page header. This is a page-body check, not a certificate for the entire file, footer or application schema. [page CRC]

In the version tested here, write_page_checksum=False and page_checksum_verification=False are independent defaults. Turning on the reader setting does not retroactively supply evidence the writer omitted. [reader API] [writer API]

Row groups are not pages

A row group partitions rows logically. Each column has a separate column chunk for that group, containing its pages. In this flat two-column fixture, two row groups therefore produce four column chunks. Selecting the second group and selecting only id exclude different portions of the same file. [format concepts]

The footer tells the reader where chunks are located. Page-body CRCs do not validate that footer or the page headers. This follows from the documented format. The payload experiment below changes a value; the separate statistics experiment changes footer metadata. A full logical scan, a trusted artifact digest and application-level checks answer different questions. [file layout] [page CRC]

One bit, nine read cases

We generated two files with the same 128 synthetic records: an id column and a measurement column, both required 64-bit integers. Two row groups contain 64 rows each. One file has page checksums; the other does not. Neither file uses compression, encryption or dictionary encoding.

In a copy of each file, we flipped the low bit of measurement row 17, changing 100017 to 100016. These numbers are invented test inputs, not sensor data. The injector verifies that exactly one bit changed and locates the full known payload inside the column-chunk range returned by the library. Parquet's PLAIN INT64 encoding uses eight little-endian bytes per value. [encoding]

The 3 fresh-fixture repetitions produced identical results. We compare every returned selected cell with the expected table, rather than accepting a successful call or the correct number of rows.

First repetition. Unless stated otherwise, the corrupted file has CRCs and the operation reads both columns and both row groups.
CaseVerify CRCObserved outcome
Clean file, CRC presentEnabledSelected values match
Corrupt file, default readerDefaultOne wrong value returned
Corrupt file, check disabledDisabledOne wrong value returned
Corrupt file, check enabledEnabledChecksum error
Read only unmodified id columnEnabledSelected values match
Read only unmodified row groupEnabledSelected values match
Read metadata onlyNot applicableMetadata readable
Corrupt file, no CRC writtenEnabledOne wrong value returned
Clean file, no CRC writtenEnabledSelected values match

The default and explicitly disabled reads each returned all 128 rows, with one wrong measurement. The checked full read of the checksummed file raised a checksum error. A clean checked file passed, providing the positive control.

Verification enabled is not checksum presence enforced. The deliberately damaged file written without CRCs still returned the wrong measurement with verification enabled. This agrees with Arrow's versioned source: the comparison is guarded by both the reader setting and the presence of the CRC field. [checksum implementation]

The clean column and second row group also read successfully from the damaged checksummed file. Their selected values were correct; they simply did not establish anything about the excluded damaged chunk. We did not trace physical I/O, so this result concerns validation coverage, not whether prefetch happened to transfer additional bytes.

Metadata inspection reported 128 rows and two row groups without validating the altered payload. It is a useful structural observation with a narrower scope than a data scan.

Intact pages, missing query results

A fourth concern sits outside page checksums: can the metadata used to select data be trusted? In a separate PyArrow 21.0.0 experiment, a CRC-enabled query returned zero rows even though its target record remained intact. Reading the entire file with the same verification setting returned all 128 original rows; filtering that decoded table recovered the target.

Parquet stores column-chunk statistics in file metadata. Arrow's dataset reader can use them to exclude row groups whose declared bounds cannot satisfy a predicate. Page CRCs do not cover that footer. We connected the format definition to the versioned pruning code, then tested the consequence rather than inferring it from the API option alone. [format schema] [pruning implementation]

This optimization is a min-max index, or zone map: bounds can rule out a region, but an overlapping interval cannot prove that a matching value exists. Zeng et al.'s columnar-format study explains the mechanism and why clustering affects its usefulness. That performance study is context, not evidence for our injected corruption result. [Zeng et al., sections 3.5 and 5.6]

For example, valid bounds [10, 30] can reject a search for 40, but not a search for 20, even if the region contains only 10 and 30. Looser valid bounds cost extra candidate reads; invalid narrower bounds can discard a true match. This is a logical example, not a measured speedup.

The fresh fixture again contains two 64-row groups and two required INT64 columns. We use the official Parquet 2.10.0 Thrift schema and a pinned parser to change only the first group's measurement minimum from 100000 to 100032, leaving its maximum at 100063. Both legacy min and modern min_value fields are changed. This is deliberately inconsistent metadata, not a valid alternative description of the data and not a model of a random single-bit error.

The original footer must roundtrip byte-for-byte before editing. The narrowed copy differs at exactly two footer byte positions. All bytes before the footer are identical. Independently recomputed CRC32 values match all four stored page CRCs, and all decoded values match the generated input. An altered-page positive control still raises a checksum error, confirming that checking was active.

First of 3 identical fresh-fixture repetitions. Returned and expected row counts. Page verification is enabled throughout. Filter: measurement = 100017, expected id = 17.
OperationReadExpected
Original statistics, filtered read11
Narrowed minimum, filtered read01
Statistics removed, filtered read11
Wider valid bounds, filtered read11
Narrowed minimum, full scan128128
Full scan, then filter in memory11
Changed page body, full scanCRC error128

The row-group selection API selects group 0 for the original file and no groups for the narrowed copy. Removing only the affected statistics, or replacing them with wider valid bounds, restores the filtered result. These controls isolate the metadata-driven exclusion; we did not measure physical reads, prefetch traffic or query performance.

A full checked scan is not automatically a statistics audit. The narrowed file's full read succeeds because its data pages are intact. An additional comparison detects that stored minimum 100032 excludes decoded minimum 100000. For this required integer fixture, valid bounds must enclose the decoded minimum and maximum. Equality is not always required: the format allows conservative bounds, and our wider-bound control remains correct. Nulls, NaNs, logical types, ordering and truncated string bounds require additional rules outside this experiment. [format schema]

The practical inference is to distinguish byte integrity, metadata/data consistency and query-result completeness in an archive validation record. A trusted whole-file digest can reveal a change from a known artifact; it cannot establish that the producer's original statistics were correct. Do not treat this controlled invalid-footer example as a claim that Arrow mishandles valid Parquet files, that all readers behave identically, or that production archives suffer this fault at a measured rate.

Download the supplementary 21 observations, raw evidence and provenance and field definitions. The dataset's reproduction section provides the harness, pinned requirements and hash-checked Apache schema.

Related mechanism: PostgreSQL BRIN

Block Range Index (BRIN) makes the candidate-versus-match distinction concrete in PostgreSQL. Its bitmap scan retains heap-page ranges whose summaries permit a match, then the executor rechecks rows. BRIN is not a synonym for a min-max zone map: its operator classes also include Bloom, inclusion and minmax-multi summaries. [BRIN]

The storage units differ. BRIN groups adjacent heap pages; Parquet's optional page index describes data pages within a column chunk. Neither is the other's on-disk format. Choosing BRIN's pages_per_range is a granularity decision, not a row-count setting or a checksum policy. [heap ranges] [Parquet page index]

A missing BRIN summary does not mean an empty range. PostgreSQL 18.0's design keeps unsummarized ranges as scan candidates. Missing coverage therefore prevents exclusion rather than justifying it. Summarization can restore pruning opportunities; it does not authenticate the data. This normal-operation rule is not a guarantee against corrupt index metadata. [versioned design]

Summary-based execution has a second boundary: an answer can come from metadata without reading the represented rows. Moerkotte's VLDB 1998 paper describes Small Materialized Aggregates over consecutive tuple buckets. It separates buckets that certainly qualify, certainly do not qualify, and still need inspection. With suitable stored aggregates, qualifying buckets can contribute directly to an aggregate answer; ambiguous buckets require tuple inspection. This is broader than min-max rejection alone. [Moerkotte, sections 2.3 and 3]

The distinction matters here: BRIN's documented bitmap path still rechecks candidate rows. It does not inherit the paper's metadata-only aggregation path or its historical benchmark results. For archive validation, our inference is to ask which operation actually consumed and checked payload values, even when a summary yields the correct answer. The same question connects this comparison to the row-count experiment below.

This is a source-based comparison, not a PostgreSQL reproduction of the Parquet fault experiment above. Our engineering inference is to record candidate selection, row-level predicate evaluation and integrity validation separately. A successful selective query cannot establish that skipped regions were checked.

BRIN after DELETE: correct answers, avoidable rechecks

Deleting the largest value did not tighten the existing summary in our PostgreSQL 16.15 test. Neither summarizing the already summarized range nor ordinary VACUUM changed that. Only explicit desummarization followed by rebuilding narrowed the bounds and avoided a heap-page visit for the now-absent value. This is a maintenance experiment, not a corruption test.

We used three fresh private clusters, each with integers 1 through 100 plus 1000000 on one 8192-byte heap page. The sole index used int4_minmax_ops, pages_per_range=1 and disabled autosummarization. Autovacuum and parallel query were off. Seven stages and two predicates produced 42 stage/query observations; exact bitmap-scan answers matched forced sequential-scan answers and an independent expected-value list.

First of three identical fresh-cluster repetitions. Query: v = 1000000. Heap blocks are executor visits, not physical disk reads; rejected rows are visible tuples failing the predicate recheck.
StageMatchesHeap blocksRejected rows
Before deletion11100
After DELETE01100
Summarize existing01100
After VACUUM01100
Desummarized01100
Rebuilt000
Summarize again000

The bounds stayed 1..1000000 after deletion and vacuuming, then became 1..100 after rebuilding. Summarizing an existing range returned 0; rebuilding the missing summary returned 1. The positive control v = 50 continued to return exactly 50 in every stage. The missing-summary stage still scanned the page. These results illustrate the documented maintenance contract, not an index correctness failure. [maintenance functions]

Inspect the active reference, not just recognizable bytes. A raw pageinspect scan still exposed the old tuple after desummarization, while the range-map entry was invalid. Our final harness follows that entry to find the active summary. The versioned implementation invalidates the range-map pointer and deletes the index tuple without compacting the page. [inspection API] [implementation]

Download the native replay, raw plans and observations, negative-control tests and method and reproduction instructions. This is one build and one deliberately tiny fixture with forced plans, no retained old snapshot, and vacuum before rebuilding. It establishes neither a speedup nor a large-table maintenance recommendation. No physical I/O, concurrent workload or PostgreSQL 18 execution was measured.

A correct row count can leave a damaged page unchecked

Counting records is not the same operation as validating their values. In a separate PyArrow 21.0.0 experiment, Dataset.count_rows() returned 128 for a file whose checked full scan raised a CRC error. Even a scanner explicitly constructed with columns=["measurement"] returned 128 when asked to count. These are correct counts, not evidence that the damaged measurement was checked.

We wrote fresh 128-row, two-column files with page CRCs, both with and without column statistics. Each has two 64-row groups. A one-bit mutation changes measurement row 17 from 100017 to 100016, leaving the footer byte-identical. Ten operations run on each clean and damaged file, with both statistics settings, for three repetitions: 120 observations. All successful full scans are compared cell by cell; the unchecked damaged scan returns exactly that one changed value.

Damaged files, first repetition. CRC verification is enabled in every row. The two columns compare separately written fixtures; neither footer is edited.
OperationStats presentStats absent
Count all128128
Count with measurement projection128128
Table with no columns128128
Count measurement >= 100000128CRC error
Count measurement < 1000000CRC error
Count measurement == 100017CRC errorCRC error
Count id == 1711
Count measurement >= 10006464CRC error
Read every valueCRC errorCRC error

The broad predicate measurement >= 100000 counts all rows; measurement < 100000 counts none. Both succeed on the damaged file when statistics are present, but both raise CRC errors without statistics. An exact search for measurement == 100017 raises a CRC error in either configuration. An exact search on the undamaged id column returns 1 in both. Thus, adding a filter does not by itself turn a count into an integrity check.

The versioned implementation explains the boundary. TryCountRows uses metadata if each row group can be wholly included or excluded; otherwise it requests a scan. The scanner's count path removes its output projection, so naming a column in the scanner does not force that column to be returned or validated by counting. This is a source-backed explanation of the observed API results, not a physical-I/O trace. [count implementation] [scanner implementation]

A table requested with columns=[] also carries 128 rows and no values. The ordinary full checked scan remains the positive detection control, and all clean controls pass. Separately, the second-group predicate returns 64 with statistics, but encounters the corrupted first-group measurement when statistics are absent. Disabling statistics is a diagnostic control here, not a recommended integrity policy: unfiltered counting still succeeds without statistics.

For archive verification, record the operation as well as the verification flag. A matching count is useful for cardinality checks. To validate values, consume the intended columns and rows with checking enabled, and compare them against independent application expectations where possible. This extends the earlier checksum-presence and footer-consistency findings; it does not make a full scan an authentication or freshness proof.

Download the standalone harness and all observations, values, environment and source hash. With PyArrow 21.0.0 installed, run python3 parquet-count-coverage.py --output observations.json. The script accepts no input database, creates private temporary fixtures and refuses an existing output path. Repetitions are controlled checks, not a population sample or a measured error rate. No compression, encryption, dictionary, null or nested data, timing, network storage or physical read coverage was tested.

Row-count supplement recorded 2026-10-21 UTC. The corpus supplement retains the same raw evidence.

A successful first batch is not a completed scan

Our streaming control returned 64 correct rows before the next iterator step raised a checksum error. The same damaged file also returned its first batch without error when the caller deliberately stopped there. Starting a checked scan is not the same as completing it.

This separate experiment uses 128 rows in four 32-row groups, with the one-bit fault moved to measurement row 81 in the third group. Four operations run with batch sizes of 16 and 64, on clean and damaged files, three times: 48 controlled observations. Each delivered value is compared with its generated expected value, without collecting the full decoded table. The footer is unchanged and all pages were written with CRCs.

Damaged fixture, first repetition, batch size 64. Rows consumed means values delivered to our loop, not bytes physically read.
OperationRows consumedFinal outcome
Stop after first batch64Caller stopped
Consume all, CRC on64CRC error
Consume id only, CRC on128Only id checked
Consume all, CRC off128One wrong value

With CRC checking enabled, consuming both columns fails after 64 delivered rows at either batch size. Reading only id reaches 128 rows without touching the damaged measurement in the value comparison. Disabling CRC checking reaches the end but returns 100080 instead of 100081 at row 81. Clean full scans reach all 128 rows and match every value. The harness records normal exhaustion, caller termination and error separately.

The implementation setting matters: ParquetFile.iter_batches limits records yielded per batch and permits column and row-group selection. It is not a promise that the first yielded batch validates the rest of the file. In these flat fixtures, the largest two-column yielded batch reports 256 or 1024 bytes through Arrow's nbytes; that is not peak process memory, decoder memory or a prefetch bound. No memory or throughput benchmark was performed. [batch API]

The design context is older than this API. Melnik and colleagues' Dremel paper (VLDB 2010, sections 2 and 4) explains how column-striped nested data permits retrieving selected fields without reconstructing every field. Our inference for integrity work is that query scope must be explicit. This tiny PyArrow fault experiment neither reproduces Dremel's distributed performance results nor attributes a Parquet checksum guarantee to that paper. [Dremel]

Mark a validation run complete only after its intended stream finishes successfully. Record the immutable input identity, expected columns and row scope, consumed count, terminal state and value-check results. Do not convert an exception into a successful partial total. Complete value matching and CRC policy are separate fields: even an unchecked clean scan can match the fixture oracle.

Download the streaming harness and raw observations and provenance, or use the corpus record. With PyArrow 21.0.0, run python3 parquet-stream-coverage.py --output stream.json. The harness uses disposable generated files, refuses existing output paths and does not accept an archive as input. This is a version-scoped API experiment, not a production archive validator, field-error estimate, authentication proof or physical-I/O trace.

What an archive validation record should say

Our engineering conclusion is to record three separate facts: which artifacts were written with checksums, which reader policy was used, and which data the validation actually covered. A successful preview or sample query should not be reported as whole-file verification.

  1. Writer evidence: record the writer version, checksum configuration and immutable artifact identity. A setting used for new files says nothing about older files from another producer.
  2. Reader evidence: record the actual verification setting. In this tested implementation, checked reading is not a strict rejection policy for missing CRCs.
  3. Coverage evidence: distinguish metadata inspection, projected columns, selected row groups and a scan of all logical data. Complete consumption with verification can check present CRCs on pages read; it is still not proof of checksum presence on every page.
  4. Independent identity: retain a trusted whole-artifact digest or manifest when unchanged bytes matter. A digest calculated only after corruption cannot identify the earlier correct artifact. Application checks must separately validate schema, units and relationships.

These are complementary checks, not reasons to disable column pruning in normal queries. Separate routine query execution from a deliberately scoped validation job. On large archives, schedule and record validation coverage instead of silently equating the latest successful query with a scrub.

The same distinction connects this result to Hesela's checksum identity analysis, backup verification limits and HDF5 application-consistency experiment: each check answers a particular question. None automatically validates every other layer.

Reproduce and inspect the evidence

The dataset page provides all 27 observations as CSV, raw JSON, environment, source hashes and exact fault offsets. Download the Python harness and pinned requirements together:

python3 -m venv .venv
.venv/bin/pip install --only-binary=:all: -r parquet-integrity-requirements.txt
.venv/bin/python parquet-integrity.py --repetitions 3 --output observations.json

The runner creates only disposable temporary fixtures and refuses an existing output path. It uses explicit checks that remain active under Python optimization and rejects an unexpected result instead of publishing it as a passing observation. The pin identifies the tested release, not the latest available version.

Environment: Python 3.12.3, PyArrow and Arrow C++ 21.0.0, Linux 6.8.0-146-generic, x86_64. The checksummed fixture was 3077 bytes; its altered byte offset was 791. Those offsets describe this fixture, not a general recipe for editing Parquet files.

What this does not establish

This is a controlled demonstration of API behavior on one host, not a field-error sample, benchmark, corruption-detection probability or power-loss test. Repeating the same chosen fault does not estimate how often real corruption occurs. No confidence interval is warranted.

The payload and statistics experiments did not test compressed, encrypted, nested or dictionary pages, other Parquet implementations, page-header damage, arbitrary footer faults, malicious tampering, concurrent mutation or remote storage. Some other corruptions may fail to decode even without CRC verification. The bounded result is that this validly decodable changed value did not fail under the specified unchecked or absent-CRC conditions.

Primary sources

  1. Apache Parquet: page checksumming
  2. Apache Arrow 21.0: read_table checksum verification and column selection
  3. Apache Arrow 21.0: write_table page checksum option
  4. Apache Arrow 21.0.0: SerializedPageReader checksum presence guard
  5. Apache Parquet: PLAIN INT64 encoding
  6. Apache Parquet: file, column and page metadata
  7. Apache Parquet format 2.10.0: Statistics, PageHeader and FileMetaData
  8. Apache Arrow 21.0.0: row-group filtering from statistics expressions
  9. Apache Parquet: row groups, column chunks and pages
  10. Apache Parquet: file layout and metadata
  11. Zeng et al. An Empirical Evaluation of Columnar Storage Formats. PVLDB 17(2), 148-161, 2023. DOI: 10.14778/3626292.3626298
  12. Apache Arrow 21.0.0: metadata-only row counting and scan fallback
  13. Apache Arrow 21.0.0: CountRows removes the output projection
  14. Apache Arrow 21.0: ParquetFile streaming batches and checksum verification
  15. Melnik et al. Dremel: Interactive Analysis of Web-Scale Datasets. PVLDB 3(1), 330-339, 2010; sections 2 and 4.
  16. Guido Moerkotte. Small Materialized Aggregates: A Light Weight Index Structure for Data Warehousing. VLDB 1998, pp. 476-487; sections 2.3 and 3.
  17. PostgreSQL 18: BRIN indexes and operator classes
  18. PostgreSQL REL_18_0: BRIN scan and unsummarized-range design
  19. Apache Parquet: optional page index
  20. PostgreSQL 16: BRIN index maintenance functions
  21. PostgreSQL 16: pageinspect BRIN functions
  22. PostgreSQL REL_16_15: brinRevmapDesummarizeRange

Source review: 17 October 2026; row-count supplement: 21 October 2026. BRIN source comparison: 18 November 2026. Experimental outputs are Hesela's own synthetic-fixture observations.

Published by Hesela team · Published · Updated

Report a correction · Editorial standards · Reuse guidance

Change history

: first published.

: latest recorded update. A detailed change note is not available for this revision.

New-publication RSS · Correction RSS

Cite this page
Hesela team. Parquet checksums: a successful read is not a file integrity check. Hesela. 2026-11-18. https://hesela.com/analyses/parquet-checksums-read-coverage/