Skip to contents

spec_arrow_fetch_arrow_chunk

Value

dbFetchArrowChunk() always returns an object coercible to a data.frame with as many rows as records were fetched and as many columns as fields in the result set, even if the result is a single value or has one or zero rows.

Failure modes

An attempt to fetch from a closed result set raises an error.

Specification

Fetching multi-row queries with one or more columns returns the next chunk. The size of the chunk is implementation-specific. The object returned by dbFetchArrowChunk() can also be passed to nanoarrow::as_nanoarrow_array() to create a nanoarrow array object. The chunk size is implementation-specific. Each chunk carries the schema of the result: nanoarrow::infer_nanoarrow_schema() applied to the object returned by dbFetchArrowChunk() gives a struct schema with one child per column, named like the columns. The names and formats of the children are the same for all chunks of a result, including the zero-length chunk returned after dbHasCompleted() has returned TRUE.