pub struct RecordBatchDecoder<'a> { /* private fields */ }Expand description
State for decoding Arrow arrays from an IPC RecordBatch structure to
RecordBatch
Implementations§
Source§impl<'a> RecordBatchDecoder<'a>
impl<'a> RecordBatchDecoder<'a>
Sourcepub fn try_new(
buf: &'a Buffer,
batch: RecordBatch<'a>,
schema: SchemaRef,
dictionaries_by_id: &'a HashMap<i64, ArrayRef>,
metadata: &'a MetadataVersion,
) -> Result<Self, ArrowError>
pub fn try_new( buf: &'a Buffer, batch: RecordBatch<'a>, schema: SchemaRef, dictionaries_by_id: &'a HashMap<i64, ArrayRef>, metadata: &'a MetadataVersion, ) -> Result<Self, ArrowError>
Create a reader for decoding arrays from an encoded RecordBatch
Sourcepub fn with_projection(self, projection: Option<&'a [usize]>) -> Self
pub fn with_projection(self, projection: Option<&'a [usize]>) -> Self
Set the projection (default: None)
If set, the projection is the list of column indices that will be read
Sourcepub fn with_require_alignment(self, require_alignment: bool) -> Self
pub fn with_require_alignment(self, require_alignment: bool) -> Self
Set require_alignment (default: false)
If true, buffers must be aligned appropriately or error will result. If false, buffers will be copied to aligned buffers if necessary.
Sourcepub fn with_skip_validation(self, skip_validation: UnsafeFlag) -> Self
pub fn with_skip_validation(self, skip_validation: UnsafeFlag) -> Self
Specifies if validation should be skipped when reading data (defaults to false)
When enabled, the following checks are bypassed:
- Offset bounds (e.g. list/string offsets pointing past the end of their value buffer)
- UTF-8 validity of string columns (
Utf8/LargeUtf8) - Null count consistency and buffer length checks
§Safety
Relies on the caller only passing a flag with true value if they are
certain that the data is valid. Invalid data that bypasses these checks
may cause undefined behavior when the arrays are later accessed.
Sourcepub fn read_record_batch(self) -> Result<RecordBatch, ArrowError>
pub fn read_record_batch(self) -> Result<RecordBatch, ArrowError>
Read the record batch, consuming the reader