pass_arrow_record_batch: Pass an Arrow RecordBatch back and forth

Description Usage Arguments Details Value Examples

View source: R/extendr-wrappers.R

Description

Demonstrates a strategy for passing an Arrow RecordBatch from/to R

Usage

1

Arguments

srb

a raw vector representing the contents of an IPC buffer

Details

The majority of the work here is being done by the RecordBatches struct and associated functions that transform a serialized RecordBatch (raw vector) into RecordBatches and back to a serialized RecordBatch using the IPC specification.

Value

RecordBatches to be serialized back to an IPC buffer

Examples

1
2
3
4
mtcars_rb <- arrow::record_batch(mtcars)
mtcars_out <- arrow::write_to_raw(mtcars_rb, "stream")
mtcars_in_buffer <- as.raw(pass_arrow_record_batch(mtcars_out))
mtcars_in <- arrow::read_ipc_stream(mtcars_in_buffer)

ericwburden/rustbind documentation built on April 10, 2021, 12:31 p.m.