Skip to main content

ColumnValueDecoder

Trait ColumnValueDecoder 

Source
pub trait ColumnValueDecoder {
    type Buffer;

    // Required methods
    fn new(col: &ColumnDescPtr) -> Self;
    fn set_dict(
        &mut self,
        buf: Bytes,
        num_values: u32,
        encoding: Encoding,
        is_sorted: bool,
    ) -> Result<()>;
    fn set_data(
        &mut self,
        encoding: Encoding,
        data: Bytes,
        num_levels: usize,
        num_values: Option<usize>,
    ) -> Result<()>;
    fn read(
        &mut self,
        out: &mut Self::Buffer,
        num_values: usize,
    ) -> Result<usize>;
    fn skip_values(&mut self, num_values: usize) -> Result<usize>;
}
Expand description

Decodes value data

Required Associated Types§

Required Methods§

Source

fn new(col: &ColumnDescPtr) -> Self

Create a new ColumnValueDecoder

Source

fn set_dict( &mut self, buf: Bytes, num_values: u32, encoding: Encoding, is_sorted: bool, ) -> Result<()>

Set the current dictionary page

Source

fn set_data( &mut self, encoding: Encoding, data: Bytes, num_levels: usize, num_values: Option<usize>, ) -> Result<()>

Set the current data page

  • encoding - the encoding of the page
  • data - a point to the page’s uncompressed value data
  • num_levels - the number of levels contained within the page, i.e. values including nulls
  • num_values - the number of non-null values contained within the page (V2 page only)

Note: data encoded with Encoding::RLE may not know its exact length, as the final run may be zero-padded. As such if num_values is not provided (i.e. None), subsequent calls to ColumnValueDecoder::read may yield more values than non-null definition levels within the page

Source

fn read(&mut self, out: &mut Self::Buffer, num_values: usize) -> Result<usize>

Read up to num_values values into out

§Panics

Implementations may panic if range overlaps with already written data

Source

fn skip_values(&mut self, num_values: usize) -> Result<usize>

Skips over num_values values

Returns the number of values skipped

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§