Skip to content

GH-53138: [R][Parquet] Expose page checksum verification in ParquetReaderProperties - #55831

Open
cvp2004 wants to merge 1 commit into
apache:mainfrom
cvp2004:GH-53138-r-page-checksum-verification
Open

cvp2004 wants to merge 1 commit into
apache:mainfrom
cvp2004:GH-53138-r-page-checksum-verification

Conversation

@cvp2004

@cvp2004 cvp2004 commented Nov 28, 2026 •

Copy link
Copy Markdown

Rationale for this change

R users can't enable Parquet page CRC verification. ParquetReaderProperties only exposes the Thrift size limits, while C++ (ReaderProperties::set_page_checksum_verification) and Python (page_checksum_verification=) already support it. As a result, files with corrupt page checksums, such as parquet-testing's datapage_v1-corrupt-checksum.parquet, are read silently.

What changes are included in this PR?

  • ParquetReaderProperties$page_checksum_verification() and $set_page_checksum_verification() in R, bound to the existing C++ ReaderProperties methods. The default stays FALSE.
  • Regenerated arrowExports (via data-raw/codegen.R) and ParquetReaderProperties.Rd (via roxygen).

This picks up the earlier attempt in #53289, which was closed automatically by the open-PR limit rather than reviewed. Before starting, I asked the previous claimant on the issue whether they were still working on it, and I haven't had a reply yet.

Exposing the option through read_parquet() or ParquetFragmentScanOptions, which already takes the Thrift limits, is left out of this PR to keep it small. It could be a follow-up.

Are these changes tested?

Yes. A new test in test-parquet.R checks that the default is FALSE and the setter round-trips. On datapage_v1-corrupt-checksum.parquet, it checks that reading with the defaults returns all 5120 rows, and that with verification on, ReadTable() errors with CRC checksum verification failed.

Local results (Windows 11, R 4.5.3, nightly libarrow 26.0.1.100000151):

  • devtools::test(filter = "parquet"): 109 passed, 0 failed, 0 skipped (with ARROW_SOURCE_HOME set so the parquet-testing data is found).
  • Ablation: with the C++ setter call removed, both new assertions fail.
  • air, jarl, clang-format and cpplint pass on the changed files.

I did not run the full R test suite locally.

Are there any user-facing changes?

Yes: two new methods on ParquetReaderProperties. Default behavior is unchanged.

Was AI used for this PR?

In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.

The code, test and this description were generated with an AI coding assistant. I reviewed the diff before submitting.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

…ties

- parquet.cpp: bind ReaderProperties::page_checksum_verification and its setter
- parquet.R: add page_checksum_verification() / set_page_checksum_verification() to ParquetReaderProperties
- Regenerate arrowExports and ParquetReaderProperties.Rd
- test-parquet.R: corrupt-CRC parquet-testing file reads by default and errors with verification on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[R][Parquet] ParquetReaderProperties does not expose page_checksum_verification, so a corrupt page CRC reads silently

1 participant