as_nanoarrow_array_stream {nanoarrow} | R Documentation |
Convert an object to a nanoarrow array_stream
Description
In nanoarrow, an 'array stream' corresponds to the struct ArrowArrayStream
as defined in the Arrow C Stream interface. This object is used to represent
a stream of arrays with a common
schema. This is similar to an
arrow::RecordBatchReader except it can be used to represent a stream of
any type (not just record batches). Note that a stream of record batches
and a stream of non-nullable struct arrays are represented identically.
Also note that array streams are mutable objects and are passed by
reference and not by value.
Usage
as_nanoarrow_array_stream(x, ..., schema = NULL)
Arguments
x |
An object to convert to a array_stream |
... |
Passed to S3 methods |
schema |
An optional schema used to enforce conversion to a particular
type. Defaults to |
Value
An object of class 'nanoarrow_array_stream'
Examples
(stream <- as_nanoarrow_array_stream(data.frame(x = 1:5)))
stream$get_schema()
stream$get_next()
# The last batch is returned as NULL
stream$get_next()
# Release the stream
stream$release()
[Package nanoarrow version 0.5.0.1 Index]