Can the feather package in R support 64-bit integers?
When the dataset is passed to feather::write_feather()
, the column is converted to a 64-bit float, and loses precision. I'd like to avoid converting it to a character.
Here's a simplified example. In the real project, a database table (retrieved with the odbc package) has columns that are legit 64-bit integers (as specified in the bit64 package).
requireNamespace("bit64")
path <- base::tempfile(fileext = ".feather")
ds <-
tibble::tibble(
patient_id = bit64::as.integer64(1:6)
)
ds
# # A tibble: 6 x 1
# patient_id
# <int64>
# 1 1
# 2 2
# 3 3
# 4 4
# 5 5
# 6 6
feather::write_feather(x = ds, path = path)
ds_read <- feather::read_feather(path)
# # A tibble: 6 x 1
# patient_id
# <dbl>
# 1 Inf.Nae-324
# 2 Inf.Nae-324
# 3 1.50e-323
# 4 2.00e-323
# 5 2.50e-323
# 6 3.00e-323
as.integer(ds_read$patient_id)
# Returns: [1] 0 0 0 0 0 0
unlink(path_out)
Note: I don't want to store them as floats, as suggested here.