RecordBatchFileWriter and RecordBatchStreamWriter are
interfaces for writing record batches to either the binary file or streaming
format.
writer <- RecordBatchStreamWriter$create(sink, schema)writer$write_batch(batch) writer$write_table(table) writer$close()
The RecordBatchFileWriter$create() and RecordBatchStreamWriter$create()
factory methods instantiate the object and
take a single argument, named according to the class:
sink A character file name or an OutputStream.
schema A Schema for the data to be written.
$write(x): Write a RecordBatch, Table, or data.frame, dispatching
to the methods below appropriately
$write_batch(batch): Write a RecordBatch to stream
$write_table(table): Write a Table to stream
$close(): close stream