arrow::to_duckdb()
converts int64 columns to a double in the duckdb table. This happens if the .data
being converted is an R data frame or a parquet file. How can I maintain the int64 data type?
Example
library(arrow, warn.conflicts = FALSE)
library(tidyverse, warn.conflicts = FALSE)
library(vroom, warn.conflicts = FALSE)
# tibble with an int64 column
dd <- vroom(I("id\n9007199254740993\n"), col_type = "I", delim = ",")
dd
#> # A tibble: 1 × 1
#> id
#> <int64>
#> 1 9e15
# it's coereced to a double
to_duckdb(dd)
#> # Source: table<arrow_001> [1 x 1]
#> # Database: DuckDB 0.8.1 [root@Darwin 22.5.0:R 4.3.1/:memory:]
#> id
#> <dbl>
#> 1 9.01e15