as_nanoarrow_array_stream: 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)
Value
An object of class 'nanoarrow_array_stream'
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 infer_nanoarrow_schema().
(stream <- as_nanoarrow_array_stream(data.frame(x = 1:5)))
stream$get_schema()
stream$get_next()
# The last batch is returned as NULLstream$get_next()
# Release the streamstream$release()