Expand description
Zero-copy Arrow IPC stream read/write utilities.
Provides helpers for serializing and deserializing RecordBatches as
self-delimiting Arrow IPC streams using synchronous Read/Write I/O.
These are designed for embedding IPC streams inside larger binary formats (e.g. a cache entry that contains multiple IPC sections). Each stream is self-delimiting (schema + batches + EOS marker) and can be read back independently.
§Zero-copy reads
read_ipc_stream and read_ipc_stream_single take &Bytes and use
Bytes::slice to produce each message buffer. Because Bytes::slice
increments a reference count rather than copying, the resulting
Buffers — and the array data decoded from them by FileDecoder —
are all backed by the same allocation as the input.
Functions§
- read_
ipc_ stream - Read all
RecordBatches from one Arrow IPC stream. - read_
ipc_ stream_ at - Read all
RecordBatches from one Arrow IPC stream starting atoffset, advancingoffsetpast the stream (including the EOS marker). - read_
ipc_ stream_ single - Read exactly one
RecordBatchfrom one Arrow IPC stream. - read_
ipc_ stream_ single_ at - Read exactly one
RecordBatchfrom one Arrow IPC stream starting atoffset, advancingoffsetpast the stream (including the EOS marker). - read_
len_ prefixed_ bytes - Read a byte slice written by
write_len_prefixed_bytes. - read_
len_ prefixed_ bytes_ at - Read a length-prefixed byte slice at
offsetindata, advancingoffset. - write_
ipc_ stream - Write
batchas a single-batch Arrow IPC stream towriter. - write_
ipc_ stream_ batches - Write all batches from
iteras a single Arrow IPC stream towriter. - write_
len_ prefixed_ bytes - Write
dataprefixed by its length as a little-endianu64.