Repository navigation
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
R users can't enable Parquet page CRC verification.
ParquetReaderPropertiesonly 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'sdatapage_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++ReaderPropertiesmethods. The default staysFALSE.arrowExports(viadata-raw/codegen.R) andParquetReaderProperties.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()orParquetFragmentScanOptions, 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.Rchecks that the default isFALSEand the setter round-trips. Ondatapage_v1-corrupt-checksum.parquet, it checks that reading with the defaults returns all 5120 rows, and that with verification on,ReadTable()errors withCRC 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 (withARROW_SOURCE_HOMEset so the parquet-testing data is found).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:
Reviewed before submission by: