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.
Constants§
- IPC_
SECTION_ ALIGNMENT - Byte alignment that each IPC section’s stream start is padded to.
Functions§
- read_
ipc_ section_ at - Read a single
RecordBatchfrom an aligned IPC section atoffset. - read_
ipc_ section_ batches_ at - Read all
RecordBatches from an aligned multi-batch IPC section atoffset, advancingoffsetpast the section (padding + stream + EOS). - 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_ section - Write
batchas a 64-byte-aligned single-batch Arrow IPC section. - write_
ipc_ section_ batches - Write
batchesas a single 64-byte-aligned multi-batch Arrow IPC section. - 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.