parquet::schema::types

Struct SchemaDescriptor

Source
pub struct SchemaDescriptor {
    schema: TypePtr,
    leaves: Vec<ColumnDescPtr>,
    leaf_to_base: Vec<usize>,
}
Expand description

Schema of a Parquet file.

Encapsulates the file’s schema (Type) and ColumnDescriptors for each primitive (leaf) column.

Fields§

§schema: TypePtr

The top-level logical schema (the “message” type).

This must be a Type::GroupType where each field is a root column type in the schema.

§leaves: Vec<ColumnDescPtr>

The descriptors for the physical type of each leaf column in this schema

Constructed from schema in DFS order.

§leaf_to_base: Vec<usize>

Mapping from a leaf column’s index to the root column index that it comes from.

For instance: the leaf a.b.c.d would have a link back to a:

-- a  <-----+
-- -- b     |
-- -- -- c  |
-- -- -- -- d

Implementations§

Source§

impl SchemaDescriptor

Source

pub fn new(tp: TypePtr) -> Self

Creates new schema descriptor from Parquet schema.

Source

pub fn column(&self, i: usize) -> ColumnDescPtr

Returns ColumnDescriptor for a field position.

Source

pub fn columns(&self) -> &[ColumnDescPtr]

Returns slice of ColumnDescriptor.

Source

pub fn num_columns(&self) -> usize

Returns number of leaf-level columns.

Source

pub fn get_column_root(&self, i: usize) -> &Type

Returns column root Type for a leaf position.

Source

pub fn get_column_root_ptr(&self, i: usize) -> TypePtr

Returns column root Type pointer for a leaf position.

Source

pub fn get_column_root_idx(&self, leaf: usize) -> usize

Returns the index of the root column for a field position

Source

fn column_root_of(&self, i: usize) -> &TypePtr

Source

pub fn root_schema(&self) -> &Type

Returns schema as Type.

Source

pub fn root_schema_ptr(&self) -> TypePtr

Returns schema as TypePtr for cheap cloning.

Source

pub fn name(&self) -> &str

Returns schema name.

Trait Implementations§

Source§

impl Debug for SchemaDescriptor

Source§

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

Formats the value using the given formatter. Read more
Source§

impl HeapSize for SchemaDescriptor

Source§

fn heap_size(&self) -> usize

Return the size of any bytes allocated on the heap by this object, including heap memory in those structures Read more
Source§

impl PartialEq for SchemaDescriptor

Source§

fn eq(&self, other: &SchemaDescriptor) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SchemaDescriptor

Auto Trait Implementations§

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, 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> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

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

§

impl<T> MaybeSendSync for T