GitHub user mskyttner created a discussion: R w adbi package reading from
FlightSQL server - could duckdb type UBIGINT and BIGINT be treated as bit64 in
R?
After successfully connecting to a FlightSQL sever (gizmo-data/gizmo) -
exposing a duckdb v 1.4 database - listing the tables works as does retrieving
tables but would it be possible to infer those fields of type UBIGINT or BIGINT
as bit64 integers? Currently those become double and it looks like RPostgres
and some others have an option to use bit64 integers there.
```r
library(adbi)
library(adbcdrivermanager)
library(adbcflightsql)
con <-
adbi::dbConnect(adbi::adbi("adbcflightsql"),
uri = "grpc://<redacted>:31337/",
username = "demetrius",
password = "demetrius"
)
con
#<AdbiConnection>
# Vendor name: gizmosql
# Vendor version: duckdb v1.4.0
# Vendor arrow version: 21.0.0
# Driver name: ADBC Flight SQL Driver - Go
# Driver version: (unknown or development build)
# Driver arrow version: v18.4.1
# NA: NA
# this works
adbi::dbListTables(con)
# this works
at <- DBI::dbReadTableArrow(con, "publishers")
# at$get_schema()
# nanoarrow::infer_nanoarrow_schema(at)
adbi::dbReadTableArrow(con, "institutions") |>
as_tibble()
adbi::dbGetQueryArrow(con, "from institutions limit 5") |>
as_tibble()
# this works
dplyr::tbl(con, "topics")
# doesn't work probably because of 64-bit integers (?)
dplyr::tbl(con, "publishers")
#Error in nanoarrow::convert_array_stream(x, to) :
# 21 value(s) outside integer range set to NA
```
GitHub link: https://github.com/apache/arrow-nanoarrow/discussions/812
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]