parquet::arrow::record_reader::definition_levels

Struct PackedDecoder

Source
struct PackedDecoder {
    data: Bytes,
    data_offset: usize,
    rle_left: usize,
    rle_value: bool,
    packed_count: usize,
    packed_offset: usize,
}
Expand description

An optimized decoder for decoding RLE and BIT_PACKED data with a bit width of 1 directly into a bitmask

This is significantly faster than decoding the data into [i16] and then computing a bitmask from this, as not only can it skip this buffer allocation and construction, but it can exploit properties of the encoded data to reduce work further

In particular:

  • Packed runs are already bitmask encoded and can simply be appended
  • Runs of 1 or 0 bits can be efficiently appended with byte (or larger) operations

Fields§

§data: Bytes§data_offset: usize§rle_left: usize§rle_value: bool§packed_count: usize§packed_offset: usize

Implementations§

Source§

impl PackedDecoder

Source

fn next_rle_block(&mut self) -> Result<()>

Source

fn decode_header(&mut self) -> Result<i64>

Decodes a VLQ encoded little endian integer and returns it

Source§

impl PackedDecoder

Source

fn new() -> Self

Source

fn set_data(&mut self, encoding: Encoding, data: Bytes)

Source

fn read( &mut self, buffer: &mut BooleanBufferBuilder, len: usize, ) -> Result<usize>

Source

fn skip(&mut self, level_num: usize) -> Result<(usize, usize)>

Skips level_num definition levels

Returns the number of values skipped and the number of levels skipped

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T