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 ColumnDescriptor
s 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
impl SchemaDescriptor
Sourcepub fn column(&self, i: usize) -> ColumnDescPtr
pub fn column(&self, i: usize) -> ColumnDescPtr
Returns ColumnDescriptor
for a field position.
Sourcepub fn columns(&self) -> &[ColumnDescPtr]
pub fn columns(&self) -> &[ColumnDescPtr]
Returns slice of ColumnDescriptor
.
Sourcepub fn num_columns(&self) -> usize
pub fn num_columns(&self) -> usize
Returns number of leaf-level columns.
Sourcepub fn get_column_root(&self, i: usize) -> &Type
pub fn get_column_root(&self, i: usize) -> &Type
Returns column root Type
for a leaf position.
Sourcepub fn get_column_root_ptr(&self, i: usize) -> TypePtr
pub fn get_column_root_ptr(&self, i: usize) -> TypePtr
Returns column root Type
pointer for a leaf position.
Sourcepub fn get_column_root_idx(&self, leaf: usize) -> usize
pub fn get_column_root_idx(&self, leaf: usize) -> usize
Returns the index of the root column for a field position
fn column_root_of(&self, i: usize) -> &TypePtr
Sourcepub fn root_schema(&self) -> &Type
pub fn root_schema(&self) -> &Type
Returns schema as Type
.
Sourcepub fn root_schema_ptr(&self) -> TypePtr
pub fn root_schema_ptr(&self) -> TypePtr
Returns schema as TypePtr
for cheap cloning.
Trait Implementations§
Source§impl Debug for SchemaDescriptor
impl Debug for SchemaDescriptor
Source§impl HeapSize for SchemaDescriptor
impl HeapSize for SchemaDescriptor
Source§impl PartialEq for SchemaDescriptor
impl PartialEq for SchemaDescriptor
impl StructuralPartialEq for SchemaDescriptor
Auto Trait Implementations§
impl Freeze for SchemaDescriptor
impl RefUnwindSafe for SchemaDescriptor
impl Send for SchemaDescriptor
impl Sync for SchemaDescriptor
impl Unpin for SchemaDescriptor
impl UnwindSafe for SchemaDescriptor
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