polars_arrow::io::ipc::read

Function read_batch

Source
pub fn read_batch<R: Read + Seek>(
    reader: &mut R,
    dictionaries: &Dictionaries,
    metadata: &FileMetadata,
    projection: Option<&[usize]>,
    limit: Option<usize>,
    index: usize,
    message_scratch: &mut Vec<u8>,
    data_scratch: &mut Vec<u8>,
) -> PolarsResult<RecordBatchT<Box<dyn Array>>>
Available on crate feature io_ipc only.
Expand description

Reads the record batch at position index from the reader.

This function is useful for random access to the file. For example, if you have indexed the file somewhere else, this allows pruning certain parts of the file.

ยงPanics

This function panics iff index >= metadata.blocks.len()