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

Create a ProjectionMask which selects all columns

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]

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]

Returns true if the leaf column leaf_idx is included by the mask

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.