Skip to main content

ColumnChunkMask

Struct ColumnChunkMask 

Source
pub struct ColumnChunkMask {
    row_groups: Option<Arc<[u32]>>,
    columns: Option<Arc<[u32]>>,
}
Expand description

A cheaply cloneable struct to specify column chunks for which metadata is required.

Column chunks are identified by row group index and leaf column index (the index of the column in SchemaDescriptor::columns, not the index of a root or Arrow field). This struct allows for specifying vertical slices of column chunk data (via Self::columns), horizontal slices (via Self::row_groups), or the intersection of the two (via Self::row_groups_and_columns).

Because Parquet collection cannot contain more than i32::MAX values, user provided indices outside that range will be discarded.

At present this is only used to select elements of the Page Index for decoding.

§Examples

To select columns 0 and 1 from all row groups:

let mask = ColumnChunkMask::columns([0, 1]);

To select all columns from row group 2:

let mask = ColumnChunkMask::row_groups([2]);

To select columns 1 and 3 from row group 0:

let mask = ColumnChunkMask::row_groups_and_columns([0], [1, 3]);

Fields§

§row_groups: Option<Arc<[u32]>>§columns: Option<Arc<[u32]>>

Implementations§

Source§

impl ColumnChunkMask

Source

pub fn all() -> Self

Select all row groups and columns.

Source

pub fn none() -> Self

Select no row groups or columns.

Source

pub fn columns(columns: impl IntoIterator<Item = usize>) -> Self

Select only the listed columns.

Passing an empty iterator selects no columns.

Source

pub fn row_groups(row_groups: impl IntoIterator<Item = usize>) -> Self

Select only the listed row groups.

Passing an empty iterator selects no row groups.

Source

pub fn row_groups_and_columns( row_groups: impl IntoIterator<Item = usize>, columns: impl IntoIterator<Item = usize>, ) -> Self

Select only the listed row groups and columns.

An empty iterator for either dimension selects no column chunks.

Source

pub fn includes_row_group(&self, idx: usize, num_row_groups: usize) -> bool

Returns whether row group idx is selected and within the bounds [0, num_row_groups).

Source

pub fn includes_column(&self, idx: usize, num_columns: usize) -> bool

Returns whether column idx is selected and within the bounds [0, num_columns).

Source

fn includes_index(keep: Option<&Arc<[u32]>>, idx: usize) -> bool

Source

pub fn is_all(&self) -> bool

Returns true when this mask selects every column chunk.

Source

pub fn is_none(&self) -> bool

Returns true when either configured axis is empty (and thus would select no column chunks).

This does not consider the dimensions of a particular Parquet file, so may return false when Self::column_indices or Self::row_group_indices returns an empty iterator due to all elements exceeding the provided upper bound.

Source

pub fn from_projection( projection: &ProjectionMask, schema: &SchemaDescriptor, ) -> Self

Creates a mask selecting the leaf columns in an Arrow projection.

Source

pub fn row_group_indices( &self, num_row_groups: usize, ) -> impl Iterator<Item = usize> + '_

Returns an iterator over the row group indices selected by this mask. If the mask is all then all indices in the range [0, num_row_groups) are returned.

Source

pub fn column_indices( &self, num_columns: usize, ) -> impl Iterator<Item = usize> + '_

Returns an iterator over the column indices selected by this mask. If the mask is all then all indices in the range [0, num_columns) are returned.

Source

fn axis_indices(axis: Option<&[u32]>, len: usize) -> AxisIndices<'_> ⓘ

Source

fn iter_to_set(indices: impl IntoIterator<Item = usize>) -> Option<Arc<[u32]>>

Trait Implementations§

Source§

impl Clone for ColumnChunkMask

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ColumnChunkMask

Source§

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

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

impl Default for ColumnChunkMask

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for ColumnChunkMask

Source§

impl Hash for ColumnChunkMask

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ColumnChunkMask

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ColumnChunkMask

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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> Ungil for T
where T: Send,