parquet::arrow::record_reader::buffer

Trait ValuesBuffer

Source
pub trait ValuesBuffer: Default {
    // Required method
    fn pad_nulls(
        &mut self,
        read_offset: usize,
        values_read: usize,
        levels_read: usize,
        valid_mask: &[u8],
    );
}
Expand description

A buffer that supports padding with nulls

Required Methods§

Source

fn pad_nulls( &mut self, read_offset: usize, values_read: usize, levels_read: usize, valid_mask: &[u8], )

If a column contains nulls, more level data may be read than value data, as null values are not encoded. Therefore, first the levels data is read, the null count determined, and then the corresponding number of values read to a ValuesBuffer.

It is then necessary to move this values data into positions that correspond to the non-null level positions. This is what this method does.

It is provided with:

  • read_offset - the offset in ValuesBuffer to start null padding from
  • values_read - the number of values read
  • levels_read - the number of levels read
  • valid_mask - a packed mask of valid levels

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: Copy + Default> ValuesBuffer for Vec<T>

Source§

fn pad_nulls( &mut self, read_offset: usize, values_read: usize, levels_read: usize, valid_mask: &[u8], )

Implementors§

Source§

impl ValuesBuffer for ViewBuffer

Source§

impl<I: OffsetSizeTrait> ValuesBuffer for OffsetBuffer<I>

Source§

impl<K: ArrowNativeType, V: OffsetSizeTrait> ValuesBuffer for DictionaryBuffer<K, V>