Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[R] Silent loss of data integrity for date-time and numeric attributes in write_parquet()/read_parquet()

Open Beginner friendly
#51,695 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
r

Research direction

Start at the R metadata serialization used by write_parquet() and read_parquet(), focusing on the serialize() call in the suggested fix. Confirm that double-valued attributes, including date-times, round-trip exactly through write_parquet()/read_parquet(), while existing files remain readable and no reader change is needed.

Written by the indexing model from the issue text.

Description

Component: R Type: bug
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

Dominant language
C++
Stars
17.2k
Forks
4.3k
Avg merge
4d 3h
Merged PRs (30d)
93

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/arrow

All issues in apache/arrow

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.