Struct parquet::column::writer::GenericColumnWriter

source ·
pub struct GenericColumnWriter<'a, E: ColumnValueEncoder> { /* private fields */ }
Expand description

Generic column writer for a primitive column.

Implementations§

source§

impl<'a, E: ColumnValueEncoder> GenericColumnWriter<'a, E>

source

pub fn new( descr: ColumnDescPtr, props: WriterPropertiesPtr, page_writer: Box<dyn PageWriter + 'a>, ) -> Self

Returns a new instance of GenericColumnWriter.

source

pub fn write_batch( &mut self, values: &E::Values, def_levels: Option<&[i16]>, rep_levels: Option<&[i16]>, ) -> Result<usize>

Writes batch of values, definition levels and repetition levels. Returns number of values processed (written).

If definition and repetition levels are provided, we write fully those levels and select how many values to write (this number will be returned), since number of actual written values may be smaller than provided values.

If only values are provided, then all values are written and the length of of the values buffer is returned.

Definition and/or repetition levels can be omitted, if values are non-nullable and/or non-repeated.

source

pub fn write_batch_with_statistics( &mut self, values: &E::Values, def_levels: Option<&[i16]>, rep_levels: Option<&[i16]>, min: Option<&E::T>, max: Option<&E::T>, distinct_count: Option<u64>, ) -> Result<usize>

Writer may optionally provide pre-calculated statistics for use when computing chunk-level statistics

NB: WriterProperties::statistics_enabled must be set to EnabledStatistics::Chunk for these statistics to take effect. If EnabledStatistics::None they will be ignored, and if EnabledStatistics::Page the chunk statistics will instead be computed from the computed page statistics

source

pub fn get_total_bytes_written(&self) -> u64

Returns total number of bytes written by this column writer so far. This value is also returned when column writer is closed.

Note: this value does not include any buffered data that has not yet been flushed to a page.

source

pub fn get_total_rows_written(&self) -> u64

Returns total number of rows written by this column writer so far. This value is also returned when column writer is closed.

source

pub fn get_descriptor(&self) -> &ColumnDescPtr

Returns a reference to a ColumnDescPtr

source

pub fn close(self) -> Result<ColumnCloseResult>

Finalizes writes and closes the column writer. Returns total bytes written, total rows written and column chunk metadata.

Auto Trait Implementations§

§

impl<'a, E> Freeze for GenericColumnWriter<'a, E>
where E: Freeze, <E as ColumnValueEncoder>::T: Freeze,

§

impl<'a, E> !RefUnwindSafe for GenericColumnWriter<'a, E>

§

impl<'a, E> Send for GenericColumnWriter<'a, E>
where E: Send,

§

impl<'a, E> !Sync for GenericColumnWriter<'a, E>

§

impl<'a, E> Unpin for GenericColumnWriter<'a, E>
where E: Unpin, <E as ColumnValueEncoder>::T: Unpin,

§

impl<'a, E> !UnwindSafe for GenericColumnWriter<'a, E>

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

§

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

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V