[R] Silent loss of data integrity for date-time and numeric attributes in write_parquet()/read_parquet()
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- r
調査の方向性
write_parquet() と read_parquet() で使用される R メタデータのシリアライズから始め、提案された修正にある serialize() の呼び出しに注目してください。日時を含む double 値の属性が write_parquet()/read_parquet() を通して完全にラウンドトリップすること、既存のファイルも引き続き読み取り可能であり、reader の変更が不要であることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug, including details regarding any error messages, version, and platform.
Describe the bug, including details regarding any error messages, version, and platform.
Double-valued attributes, including date-times, do not round-trip through Arrow's R metadata. No warning is raised. (Tested on arrow 25.0.1, R 4.6.1, Linux.)
library(arrow)
options(digits.secs = 6)
df <- data.frame(x = 1:3)
attr(df, "updated") <- as.POSIXct("2026-10-02 14:30:15.987654321", tz = "UTC")
f <- tempfile(fileext = ".parquet")
write_parquet(df, f)
back <- read_parquet(f)
attr(df, "updated")
#> [1] "2026-10-02 14:30:15.987654 UTC"
attr(back, "updated")
#> [1] "2026-10-02 14:30:15.987653 UTC"
identical(attr(back, "updated"), attr(df, "updated"))
#> [1] FALSE
Suggested fix
Fortuitously, R already has an exact variant of the ASCII format, so the fix is simple and fully backwards compatible.
Arrow uses R_pstream_ascii_format (ascii = TRUE in base::serialize). Instead use R_pstream_asciihex_format (ascii = NA).
out <- serialize(safe_r_metadata(x, on_save = TRUE), NULL, ascii = NA)
The hex format means that doubles are written out in hex instead of decimal.
Either way, the output still starts with "A" (arrow's check) and base unserialize() reads it fine, so the reader needs no change and previous versions work with the output.
Component(s)
R
- 主要言語
- C++
- スター
- 17.2k
- フォーク
- 4.3k
- 平均マージ
- 4日 12時間
- マージ済み PR(30日)
- 102
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/arrow のほかの issue
-
[C++][Parquet] Plaintext-footer files written with AES_GCM_CTR_V1 record AES_GCM_V1 as the encryption algorithm and cannot be read対応中かも @YusefSyed が 1 日前に担当しました。 オープン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 日以内に返信
-
Component: C++ Type: enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
-
Component: GLib
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
WebAssembly/binaryen#9207 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
godotengine/godot#124139 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
ChicoState/autovalidate#195 ·