| duckdb_result_arrow-class | R Documentation |
Streaming Arrow result for queries on DuckDB connections. Implements DBIResultArrow-class.
## S4 method for signature 'duckdb_result_arrow'
dbBind(res, params, ...)
## S4 method for signature 'duckdb_result_arrow'
dbBindArrow(res, params, ...)
## S4 method for signature 'duckdb_result_arrow'
dbClearResult(res, ...)
## S4 method for signature 'duckdb_result_arrow'
dbColumnInfo(res, ...)
## S4 method for signature 'duckdb_result_arrow'
dbFetchArrow(res, ..., chunk_size = 1e+06)
## S4 method for signature 'duckdb_result_arrow'
dbFetchArrowChunk(res, ..., chunk_size = 1e+06)
## S4 method for signature 'duckdb_result_arrow'
dbGetRowCount(res, ...)
## S4 method for signature 'duckdb_result_arrow'
dbGetRowsAffected(res, ...)
## S4 method for signature 'duckdb_result_arrow'
dbGetStatement(res, ...)
## S4 method for signature 'duckdb_result_arrow'
dbHasCompleted(res, ...)
## S4 method for signature 'duckdb_result_arrow'
dbIsValid(dbObj, ...)
## S4 method for signature 'duckdb_result_arrow'
show(object)
res |
An object inheriting from DBI::DBIResult. |
params |
For |
... |
Other arguments passed on to methods. |
chunk_size |
The chunk size in rows used when pulling Arrow batches from DuckDB. |
dbObj |
An object inheriting from DBIObject, i.e. DBIDriver, DBIConnection, or a DBIResult |
object |
Any R object |
connectionthe duckdb_connection the query was executed on.
stmt_lstinternal list describing the prepared statement.
envenvironment holding the result's mutable fetch state.
Each batch that dbFetchArrowChunk() returns is a nanoarrow_array
whose buffers live outside R's heap, allocated by the engine.
They are freed by the batch's release callback, which runs in one of two ways.
nanoarrow::nanoarrow_pointer_release() runs it at once,
whatever else still refers to the batch, and gives the most control:
a loop that converts each batch and releases it holds one batch at a time,
however large the result.
Dropping the batch instead leaves the callback to R's garbage collector,
which runs on R's own allocations and never sees these buffers,
so batches accumulate until a collection happens;
gc() is the fallback that forces one,
and it frees a batch only if nothing refers to it any more.
Converting a batch with as.data.frame() copies numeric columns,
but character columns are converted lazily
and keep their part of the batch alive until they are materialized or dropped,
whichever way the batch itself was released.
Releasing a batch never affects the result it came from;
the next dbFetchArrowChunk() proceeds as before.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.