pub struct RepDefBuilder { /* private fields */ }
Expand description
A structure used to collect validity buffers and offsets from arrow arrays and eventually create repetition and definition levels
As we are encoding the structural encoders are given this struct and will record the arrow information into it. Once we hit a leaf node we serialize the data into rep/def levels and write these into the page.
Implementations§
Source§impl RepDefBuilder
impl RepDefBuilder
Sourcepub fn is_simple_validity(&self) -> bool
pub fn is_simple_validity(&self) -> bool
Returns true if there is only a single layer of definition
Sourcepub fn has_nulls(&self) -> bool
pub fn has_nulls(&self) -> bool
Return True if any layer has a validity bitmap
Return False if all layers are non-null (the def levels can be skipped in this case)
pub fn has_offsets(&self) -> bool
Sourcepub fn add_validity_bitmap(&mut self, validity: NullBuffer)
pub fn add_validity_bitmap(&mut self, validity: NullBuffer)
Registers a nullable validity bitmap
Sourcepub fn add_no_null(&mut self, len: usize)
pub fn add_no_null(&mut self, len: usize)
Registers an all-valid validity layer
Sourcepub fn add_offsets<O: OffsetSizeTrait>(
&mut self,
offsets: OffsetBuffer<O>,
validity: Option<NullBuffer>,
) -> bool
pub fn add_offsets<O: OffsetSizeTrait>( &mut self, offsets: OffsetBuffer<O>, validity: Option<NullBuffer>, ) -> bool
Adds a layer of offsets
Offsets are casted to a common type (i64) and also normalized. Null lists are always represented by a zero-length (identical) pair of offsets and so the caller should filter out any garbage items before encoding them. To assist with this the method will return true if any non-empty null lists were found.
Sourcepub fn serialize(builders: Vec<Self>) -> SerializedRepDefs
pub fn serialize(builders: Vec<Self>) -> SerializedRepDefs
Converts the validity / offsets buffers that have been gathered so far into repetition and definition levels
Trait Implementations§
Source§impl Clone for RepDefBuilder
impl Clone for RepDefBuilder
Source§fn clone(&self) -> RepDefBuilder
fn clone(&self) -> RepDefBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RepDefBuilder
impl Debug for RepDefBuilder
Source§impl Default for RepDefBuilder
impl Default for RepDefBuilder
Source§fn default() -> RepDefBuilder
fn default() -> RepDefBuilder
Auto Trait Implementations§
impl Freeze for RepDefBuilder
impl RefUnwindSafe for RepDefBuilder
impl Send for RepDefBuilder
impl Sync for RepDefBuilder
impl Unpin for RepDefBuilder
impl UnwindSafe for RepDefBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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