pub enum Reader {
PrimitiveReader(TypePtr, Box<TripletIter>),
OptionReader(i16, Box<Reader>),
GroupReader(Option<TypePtr>, i16, Vec<Reader>),
RepeatedReader(TypePtr, i16, i16, Box<Reader>),
KeyValueReader(TypePtr, i16, i16, Box<Reader>, Box<Reader>),
}
Expand description
Reader tree for record assembly
Variants§
PrimitiveReader(TypePtr, Box<TripletIter>)
Primitive reader with type information and triplet iterator
OptionReader(i16, Box<Reader>)
Optional reader with definition level of a parent and a reader
GroupReader(Option<TypePtr>, i16, Vec<Reader>)
Group (struct) reader with type information, definition level and list of child readers. When it represents message type, type information is None
RepeatedReader(TypePtr, i16, i16, Box<Reader>)
Reader for repeated values, e.g. lists, contains type information, definition level, repetition level and a child reader
KeyValueReader(TypePtr, i16, i16, Box<Reader>, Box<Reader>)
Reader of key-value pairs, e.g. maps, contains type information, definition level, repetition level, child reader for keys and child reader for values
Implementations§
Source§impl Reader
impl Reader
Sourcefn option(repetition: Repetition, def_level: i16, reader: Reader) -> Self
fn option(repetition: Repetition, def_level: i16, reader: Reader) -> Self
Wraps reader in option reader based on repetition.
Sourcefn is_element_type(repeated_type: &Type) -> bool
fn is_element_type(repeated_type: &Type) -> bool
Returns true if repeated type is an element type for the list. Used to determine legacy list types. This method is copied from Spark Parquet reader and is based on the reference: https://github.com/apache/parquet-format/blob/master/LogicalTypes.md #backward-compatibility-rules
Sourcefn read(&mut self) -> Result<Row>
fn read(&mut self) -> Result<Row>
Reads current record as Row
from the reader tree.
Automatically advances all necessary readers.
This must be called on the root level reader (i.e., for Message type).
Otherwise, it will panic.
Sourcefn read_field(&mut self) -> Result<Field>
fn read_field(&mut self) -> Result<Field>
Reads current record as Field
from the reader tree.
Automatically advances all necessary readers.
Sourcefn field_name(&self) -> &str
fn field_name(&self) -> &str
Returns field name for the current reader.
Sourcefn repetition(&self) -> Repetition
fn repetition(&self) -> Repetition
Returns repetition for the current reader.
Sourcefn has_next(&self) -> bool
fn has_next(&self) -> bool
Returns true, if current reader has more values, false otherwise. Method does not advance internal iterator.
Sourcefn current_def_level(&self) -> i16
fn current_def_level(&self) -> i16
Returns current definition level, Method does not advance internal iterator.
Sourcefn current_rep_level(&self) -> i16
fn current_rep_level(&self) -> i16
Returns current repetition level. Method does not advance internal iterator.
Sourcefn advance_columns(&mut self) -> Result<()>
fn advance_columns(&mut self) -> Result<()>
Advances leaf columns for the current reader.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Reader
impl !RefUnwindSafe for Reader
impl Send for Reader
impl !Sync for Reader
impl Unpin for Reader
impl !UnwindSafe for Reader
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> 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