Struct GenericColumnReader

Source
pub struct GenericColumnReader<R, D, V> { /* private fields */ }
Expand description

Reads data for a given column chunk, using the provided decoders:

  • R: ColumnLevelDecoder used to decode repetition levels
  • D: ColumnLevelDecoder used to decode definition levels
  • V: ColumnValueDecoder used to decode value data

Implementations§

Source§

impl<V> GenericColumnReader<RepetitionLevelDecoderImpl, DefinitionLevelDecoderImpl, V>
where V: ColumnValueDecoder,

Source

pub fn new(descr: ColumnDescPtr, page_reader: Box<dyn PageReader>) -> Self

Creates new column reader based on column descriptor and page reader.

Source§

impl<R, D, V> GenericColumnReader<R, D, V>
where R: RepetitionLevelDecoder, D: DefinitionLevelDecoder, V: ColumnValueDecoder,

Source

pub fn read_records( &mut self, max_records: usize, def_levels: Option<&mut D::Buffer>, rep_levels: Option<&mut R::Buffer>, values: &mut V::Buffer, ) -> Result<(usize, usize, usize)>

Read up to max_records whole records, returning the number of complete records, non-null values and levels decoded. All levels for a given record will be read, i.e. the next repetition level, if any, will be 0

If the max definition level is 0, def_levels will be ignored and the number of records, non-null values and levels decoded will all be equal, otherwise def_levels will be populated with the number of levels read, with an error returned if it is None.

If the max repetition level is 0, rep_levels will be ignored and the number of records and levels decoded will both be equal, otherwise rep_levels will be populated with the number of levels read, with an error returned if it is None.

values will be contiguously populated with the non-null values. Note that if the column is not required, this may be less than either max_records or the number of levels read

Source

pub fn skip_records(&mut self, num_records: usize) -> Result<usize>

Skips over num_records records, where records are delimited by repetition levels of 0

§Returns

Returns the number of records skipped

Auto Trait Implementations§

§

impl<R, D, V> Freeze for GenericColumnReader<R, D, V>
where V: Freeze, D: Freeze, R: Freeze,

§

impl<R, D, V> !RefUnwindSafe for GenericColumnReader<R, D, V>

§

impl<R, D, V> Send for GenericColumnReader<R, D, V>
where V: Send, D: Send, R: Send,

§

impl<R, D, V> !Sync for GenericColumnReader<R, D, V>

§

impl<R, D, V> Unpin for GenericColumnReader<R, D, V>
where V: Unpin, D: Unpin, R: Unpin,

§

impl<R, D, V> !UnwindSafe for GenericColumnReader<R, D, V>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more