[R][Parquet] ParquetReaderProperties does not expose page_checksum_verification, so a corrupt page CRC reads silently
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
r/R/parquet.R の ParquetReaderProperties クラス付近から始めてください。既存の thrift_string_size_limit アクセサが従うべきパターンを示しています。次に r/src/parquet.cpp の対応する cpp11 関数と NAMESPACE のエクスポートを確認してください。cpp/src/parquet/properties.h にある C++ のゲッターとセッターが shim から到達可能か確認してください。完了条件は、R クラスが page_checksum_verification の get と set を公開し、そのオプションを有効にして datapage_v1-corrupt-checksum.parquet を読み込むとエラーが発生することです。プルリクエストを開く前に、メンテナーがこの変更を望んでいるかを先に確認してください。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
The R bindings do not expose page_checksum_verification, so an R user has no way to turn on page-CRC verification when reading Parquet. Arrow's own deliberately-corrupt test files are read without error.
C++ has the option and Python exposes it; only R does not.
| C++ | cpp/src/parquet/properties.h:148-150 — page_checksum_verification() / set_page_checksum_verification(bool check_crc), defaulting to false at line 166 |
| Python | python/pyarrow/parquet/core.py:269,325,346 — a documented page_checksum_verification=False parameter |
| R | r/R/parquet.R:656-682 — ParquetReaderProperties declares and implements only thrift_string_size_limit and thrift_container_size_limit |
Reproduction
Using the files parquet-testing ships expressly so readers can be shown to reject a bad CRC — datapage_v1-corrupt-checksum.parquet ("uncompressed INT32 columns in v1 data pages with a mismatching CRC") and rle-dict-uncompressed-corrupt-checksum.parquet:
library(arrow)
packageVersion("arrow") # 25.0.0, libarrow 25.0.0
nrow(read_parquet("datapage_v1-corrupt-checksum.parquet")) # 5120 -- no error
nrow(read_parquet("rle-dict-uncompressed-corrupt-checksum.parquet")) # 1000 -- no error
ls(ParquetReaderProperties$create())
#> [1] "class_title" "clone" "initialize" "pointer" "print" "set_pointer"
#> [7] "set_thrift_container_size_limit" "set_thrift_string_size_limit"
#> [9] "thrift_container_size_limit" "thrift_string_size_limit"
# no page_checksum_verification
Measured on linux/aarch64, R 4.5.3, arrow 25.0.0 / libarrow 25.0.0, with parquet-testing at e74785d85a4e (the cpp/submodules/parquet-testing commit at apache-arrow-25.0.0).
Why it matters
Reading without CRC verification is a reasonable default — it matches C++ and Python. The gap is that R offers no way to opt in, so an R pipeline cannot detect page-level corruption even when it wants to. Silent corruption is the failure mode page CRCs exist to prevent, and the files above exist to prove a reader catches it.
It also means Arrow's own conformance corpus cannot be used from R for its intended purpose: those two files are supposed to fail, and from R they are indistinguishable from the matching-CRC files beside them (datapage_v1-uncompressed-checksum.parquet, plain-dict-uncompressed-checksum.parquet).
Component(s)
R, Parquet
Sketch of a fix
Not offering a PR, but the shape looks small — two accessors alongside the existing thrift ones in r/R/parquet.R:
page_checksum_verification = function() {
parquet___arrow___ReaderProperties__get_page_checksum_verification(self)
},
set_page_checksum_verification = function(check_crc) {
parquet___arrow___ReaderProperties__set_page_checksum_verification(self, check_crc)
},
plus the two cpp11 shims in r/src/parquet.cpp forwarding to the existing C++ getter/setter, and a line each in the @description block and NAMESPACE. Happy to be told if there is a reason it was left out deliberately — #36997 touched the same class for a different reason and did not add it.
- 主要言語
- C++
- スター
- 17.2k
- フォーク
- 4.4k
- 平均マージ
- 3日 9時間
- マージ済み PR(30日)
- 70
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/arrow のほかの issue
-
[C++][Python] IPC reader rejects a DictionaryEncoding without indexType, which the format allows対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンComponent: C++ Component: Python
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
[R] Silent loss of metadata integrity for date-time and numeric attributes in write_parquet()/read_parquet()再び着手できるかも @james-finn-travers が 8 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンComponent: R Type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/arrow#51695 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
[C++][Parquet] Plaintext-footer files written with AES_GCM_CTR_V1 record AES_GCM_V1 as the encryption algorithm and cannot be read対応中かも @YusefSyed が 9 日前に担当しました。 オープンType: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
[R] Expose ignore_extra_columns and pad_short_rows CSV parse options対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンComponent: R good-first-issue Type: enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 2 日以内に返信
-
Component: C++
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
objectionary/eo-graphs#85 ·
-
bug derived types format I/O medium priority semantics
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
CartLineConstraint Jacobian always writes 6 rows, overruns when indices has fewer than 6 entriesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tesseract-robotics/trajopt#618 ·
メンテナーはふだん 1 日以内に返信
-
backend bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mysql/mysql-server#847 ·
メンテナーはふだん 3 日以内に返信