[R][Parquet] ParquetReaderProperties does not expose page_checksum_verification, so a corrupt page CRC reads silently
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
- #53289 của @gitedmond — đã đóng, không merge
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Bắt đầu từ r/R/parquet.R, quanh lớp ParquetReaderProperties, nơi các accessor hiện có của thrift_string_size_limit cho thấy mẫu cần làm theo; sau đó kiểm tra các hàm cpp11 tương ứng trong r/src/parquet.cpp và các export trong NAMESPACE. Xác nhận getter và setter C++ trong cpp/src/parquet/properties.h có thể truy cập từ shim. Hoàn thành khi lớp R cung cấp get và set cho page_checksum_verification, và đọc datapage_v1-corrupt-checksum.parquet khi bật tùy chọn này sẽ phát sinh lỗi. Trước khi mở pull request, hãy kiểm tra xem maintainer có muốn thay đổi này không.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C++
- Star
- 17.2k
- Fork
- 4.4k
- Merge trung bình
- 3 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 66
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/arrow
-
[C++] Remove an unnecessary null pointer checkCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởComponent: C++ Type: enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[C++][Python] IPC reader rejects a DictionaryEncoding without indexType, which the format allowsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởComponent: C++ Component: Python Type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[R] Silent loss of metadata integrity for date-time and numeric attributes in write_parquet()/read_parquet()Có thể làm lại được @james-finn-travers đã nhận 12 ngày trước và không có pull request nào đang mở. Đang mởComponent: R Type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/arrow#51695 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[C++][Parquet] Plaintext-footer files written with AES_GCM_CTR_V1 record AES_GCM_V1 as the encryption algorithm and cannot be readCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởType: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[R] Expose ignore_extra_columns and pad_short_rows CSV parse optionsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởComponent: R good-first-issue Type: enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/arrow#51659 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
FriendsofECCE/ECCE#336 · 1 bình luận ·
-
Real literal with a 'd' exponent and a kind suffix (1.0d0_4) is accepted; the suffix is ignoredĐang mởerror not reported low priority semantics
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
bitcoin-core/gui-qml#1030 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày