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
(
buf: &Buffer,
batch: crate::RecordBatch,
schema: SchemaRef,
dictionaries_by_id: &HashMap<i64, ArrayRef>,
projection: Option<&[usize]>,
metadata: &MetadataVersion,
)
| 765 | /// (Properly aligned array data will remain zero-copy.) |
| 766 | /// Under the hood it will use [`arrow_data::ArrayDataBuilder::align_buffers`] to construct [`arrow_data::ArrayData`]. |
| 767 | pub fn read_record_batch( |
| 768 | buf: &Buffer, |
| 769 | batch: crate::RecordBatch, |
| 770 | schema: SchemaRef, |
| 771 | dictionaries_by_id: &HashMap<i64, ArrayRef>, |
| 772 | projection: Option<&[usize]>, |
| 773 | metadata: &MetadataVersion, |
| 774 | ) -> Result<RecordBatch, ArrowError> { |
| 775 | RecordBatchDecoder::try_new(buf, batch, schema, dictionaries_by_id, metadata)? |
| 776 | .with_projection(projection) |
| 777 | .with_require_alignment(false) |
| 778 | .read_record_batch() |
| 779 | } |
| 780 | |
| 781 | /// Read the dictionary from the buffer and provided metadata, |
| 782 | /// updating the `dictionaries_by_id` with the resulting dictionary |