Skip to main content

LayoutReader

Trait LayoutReader 

Source
pub trait LayoutReader:
    'static
    + Send
    + Sync {
    // Required methods
    fn name(&self) -> &Arc<str> ;
    fn as_any(&self) -> &dyn Any;
    fn dtype(&self) -> &DType;
    fn row_count(&self) -> u64;
    fn register_splits(
        &self,
        field_mask: &[FieldMask],
        split_range: &SplitRange,
        splits: &mut RowSplits,
    ) -> VortexResult<()>;
    fn pruning_evaluation(
        &self,
        row_range: &Range<u64>,
        expr: &Expression,
        mask: Mask,
    ) -> VortexResult<MaskFuture>;
    fn filter_evaluation(
        &self,
        row_range: &Range<u64>,
        expr: &Expression,
        mask: MaskFuture,
    ) -> VortexResult<MaskFuture>;
    fn projection_evaluation(
        &self,
        row_range: &Range<u64>,
        expr: &Expression,
        mask: MaskFuture,
    ) -> VortexResult<ArrayFuture>;
}
Expand description

Stateful reader for a crate::Layout.

A reader owns or references any state needed to evaluate many scan operations over the same layout, such as child readers, decoded metadata, or segment caches. Scan planning calls register_splits; execution calls pruning, filter, and projection evaluation for each selected row range.

Required Methods§

Source

fn name(&self) -> &Arc<str>

Returns the name of the layout reader for debugging.

Source

fn as_any(&self) -> &dyn Any

Returns this reader as Any for downcasting by specialized wrappers.

Source

fn dtype(&self) -> &DType

Returns the un-projected dtype of the layout reader.

Source

fn row_count(&self) -> u64

Returns the number of rows in the layout.

Source

fn register_splits( &self, field_mask: &[FieldMask], split_range: &SplitRange, splits: &mut RowSplits, ) -> VortexResult<()>

Register natural split boundaries for this reader.

field_mask contains the projected and filtered field paths needed by the scan. Implementations should add root-coordinate split boundaries to splits, constrained to split_range.

Source

fn pruning_evaluation( &self, row_range: &Range<u64>, expr: &Expression, mask: Mask, ) -> VortexResult<MaskFuture>

Returns a mask where all false values are proven to be false in the given expression.

The returned mask does not need to have been intersected with the input mask.

Source

fn filter_evaluation( &self, row_range: &Range<u64>, expr: &Expression, mask: MaskFuture, ) -> VortexResult<MaskFuture>

Refines the given mask, returning a mask equal in length to the input mask.

It is recommended to defer awaiting the input mask for as long as possible (ideally, after all I/O is complete). This allows other conjuncts the opportunity to refine the mask as much as possible before it is used.

§Post-conditions

The returned mask MUST have been intersected with the input mask.

Source

fn projection_evaluation( &self, row_range: &Range<u64>, expr: &Expression, mask: MaskFuture, ) -> VortexResult<ArrayFuture>

Evaluates an expression against an array.

It is recommended to defer awaiting the input mask for as long as possible (ideally, after all I/O is complete). This allows other conjuncts the opportunity to refine the mask as much as possible before it is used.

§Post-conditions

The returned array MUST have length equal to the true count of the input mask.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§