parquet::record::reader

Enum Reader

Source
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

Source

fn option(repetition: Repetition, def_level: i16, reader: Reader) -> Self

Wraps reader in option reader based on repetition.

Source

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

Source

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.

Source

fn read_field(&mut self) -> Result<Field>

Reads current record as Field from the reader tree. Automatically advances all necessary readers.

Source

fn field_name(&self) -> &str

Returns field name for the current reader.

Source

fn repetition(&self) -> Repetition

Returns repetition for the current reader.

Source

fn has_next(&self) -> bool

Returns true, if current reader has more values, false otherwise. Method does not advance internal iterator.

Source

fn current_def_level(&self) -> i16

Returns current definition level, Method does not advance internal iterator.

Source

fn current_rep_level(&self) -> i16

Returns current repetition level. Method does not advance internal iterator.

Source

fn advance_columns(&mut self) -> Result<()>

Advances leaf columns for the current reader.

Trait Implementations§

Source§

impl Display for Reader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T