Struct parquet::arrow::ProjectionMask
source · [−]pub struct ProjectionMask { /* private fields */ }
Expand description
A ProjectionMask
identifies a set of columns within a potentially nested schema to project
In particular, a ProjectionMask
can be constructed from a list of leaf column indices
or root column indices where:
- Root columns are the direct children of the root schema, enumerated in order
- Leaf columns are the child-less leaves of the schema as enumerated by a depth-first search
For example, the schema
message schema {
REQUIRED boolean leaf_1;
REQUIRED GROUP group {
OPTIONAL int32 leaf_2;
OPTIONAL int64 leaf_3;
}
}
Has roots ["leaf_1", "group"]
and leaves ["leaf_1", "leaf_2", "leaf_3"]
For non-nested schemas, i.e. those containing only primitive columns, the root and leaves are the same
Implementations
sourceimpl ProjectionMask
impl ProjectionMask
sourcepub fn all() -> Self
pub fn all() -> Self
Create a ProjectionMask
which selects all columns
sourcepub fn leaves(
schema: &SchemaDescriptor,
indices: impl IntoIterator<Item = usize>
) -> Self
pub fn leaves(
schema: &SchemaDescriptor,
indices: impl IntoIterator<Item = usize>
) -> Self
Create a ProjectionMask
which selects only the specified leaf columns
Note: repeated or out of order indices will not impact the final mask
i.e. [0, 1, 2]
will construct the same mask as [1, 0, 0, 2]
sourcepub fn roots(
schema: &SchemaDescriptor,
indices: impl IntoIterator<Item = usize>
) -> Self
pub fn roots(
schema: &SchemaDescriptor,
indices: impl IntoIterator<Item = usize>
) -> Self
Create a ProjectionMask
which selects only the specified root columns
Note: repeated or out of order indices will not impact the final mask
i.e. [0, 1, 2]
will construct the same mask as [1, 0, 0, 2]
sourcepub fn leaf_included(&self, leaf_idx: usize) -> bool
pub fn leaf_included(&self, leaf_idx: usize) -> bool
Returns true if the leaf column leaf_idx
is included by the mask
Trait Implementations
sourceimpl Clone for ProjectionMask
impl Clone for ProjectionMask
sourcefn clone(&self) -> ProjectionMask
fn clone(&self) -> ProjectionMask
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for ProjectionMask
impl Send for ProjectionMask
impl Sync for ProjectionMask
impl Unpin for ProjectionMask
impl UnwindSafe for ProjectionMask
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more