arrow_ipc::reader

Function read_record_batch

Source
pub fn read_record_batch(
    buf: &Buffer,
    batch: RecordBatch<'_>,
    schema: SchemaRef,
    dictionaries_by_id: &HashMap<i64, ArrayRef>,
    projection: Option<&[usize]>,
    metadata: &MetadataVersion,
) -> Result<RecordBatch, ArrowError>
Expand description

Creates a record batch from binary data using the crate::RecordBatch indexes and the Schema.

If require_alignment is true, this function will return an error if any array data in the input buf is not properly aligned. Under the hood it will use [arrow_data::ArrayDataBuilder::build] to construct [arrow_data::ArrayData].

If require_alignment is false, this function will automatically allocate a new aligned buffer and copy over the data if any array data in the input buf is not properly aligned. (Properly aligned array data will remain zero-copy.) Under the hood it will use [arrow_data::ArrayDataBuilder::build_aligned] to construct [arrow_data::ArrayData].