-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nanoarrow_array_stream or nanoarrow_array? #3
Comments
Any update on this? I tried to implement Arrow-related methods to |
The README now returns a nanoarrow array stream. The documentation at https://dbi.r-dbi.org/dev/reference/dbGetQueryArrow.html isn't very specific, intentionally. DBI's implementation for the fallback is accessible like this: DBI:::dbGetQueryArrow_DBIConnection_character
#> function(conn, statement, ...) {
#> rs <- dbSendQueryArrow(conn, statement, ...)
#> on.exit(dbClearResult(rs))
#>
#> dbFetchArrow(rs, ...)
#> }
#> <environment: namespace:DBI>
DBI:::dbFetchArrow_DBIResultArrow
#> function(res, ...) {
#> chunk <- dbFetchArrowChunk_DBIResultArrow(res)
#> # Corner case: add empty chunk only for zero rows, for schema
#> if (chunk$length == 0) {
#> return(nanoarrow::basic_array_stream(
#> list(),
#> schema = nanoarrow::infer_nanoarrow_schema(chunk),
#> validate = FALSE
#> ))
#> }
#>
#> out <- list(chunk)
#> repeat {
#> chunk <- dbFetchArrowChunk_DBIResultArrow(res)
#> if (chunk$length == 0) {
#> return(nanoarrow::basic_array_stream(
#> out,
#> schema = nanoarrow::infer_nanoarrow_schema(out[[1]]),
#> validate = FALSE
#> ))
#> }
#> out <- c(out, list(chunk))
#> }
#> }
#> <environment: namespace:DBI> Created on 2023-12-31 with reprex v2.0.2 |
I think this has been fixed, thanks! |
The DBI package documentation and the DBItest shows that methods like
dbGetQueryArrow
returnnanoarrow_array_stream
, but the README of this repository seems to returnnanoarrow_array
.Is this intentional?
adbi/README.md
Lines 98 to 99 in f56d677
The text was updated successfully, but these errors were encountered: