Skip to main content

RecordBatchDecoder

Struct RecordBatchDecoder 

Source
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>

Source

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

Source

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

Source

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.

Source

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.

Source

pub fn read_record_batch(self) -> Result<RecordBatch, ArrowError>

Read the record batch, consuming the reader

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.