Skip to main content

RowVisitor

Trait RowVisitor 

Source
pub trait RowVisitor {
    // Required methods
    fn selected_column_names_and_types(
        &self,
    ) -> (&'static [ColumnName], &'static [DataType]);
    fn visit<'a>(
        &mut self,
        row_count: usize,
        getters: &[&'a dyn GetData<'a>],
    ) -> DeltaResult<()>;

    // Provided method
    fn visit_rows_of(&mut self, data: &dyn EngineData) -> DeltaResult<()>
       where Self: Sized { ... }
}
Expand description

A RowVisitor can be called back to visit extracted data. Aside from calling RowVisitor::visit on the visitor passed to EngineData::visit_rows, engines do not need to worry about this trait.

Required Methods§

Source

fn selected_column_names_and_types( &self, ) -> (&'static [ColumnName], &'static [DataType])

The names and types of leaf fields this visitor accesses. The EngineData being visited validates these types when extracting column getters, and RowVisitor::visit will receive one getter for each selected field, in the requested order. The column names are used by RowVisitor::visit_rows_of to select fields from a “typical” EngineData; callers whose engine data has different column names can manually invoke EngineData::visit_rows.

Source

fn visit<'a>( &mut self, row_count: usize, getters: &[&'a dyn GetData<'a>], ) -> DeltaResult<()>

Have the visitor visit the data. This will be called on a visitor passed to EngineData::visit_rows. For each leaf in the schema that was passed to extract a “getter” of type GetData will be present. This can be used to actually get at the data for each row. You can use the TypedGetData trait if you want to have a way to extract typed data that will fail if the “getter” is for an unexpected type. The data in getters does not outlive the call to this function (i.e. it should be copied if needed).

Provided Methods§

Source

fn visit_rows_of(&mut self, data: &dyn EngineData) -> DeltaResult<()>
where Self: Sized,

Visit the rows of an EngineData, selecting the leaf column names given by RowVisitor::selected_column_names_and_types. This is a thin wrapper around EngineData::visit_rows which in turn will eventually invoke RowVisitor::visit.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl RowVisitor for AddVisitor

Available on crate feature internal-api only.
Source§

impl RowVisitor for CdcVisitor

Available on crate feature internal-api only.
Source§

impl RowVisitor for CheckpointVisitor

Available on crate features adaptive-metadata-in-dev and internal-api only.
Source§

impl RowVisitor for MetadataVisitor

Available on crate feature internal-api only.
Source§

impl RowVisitor for ProtocolVisitor

Available on crate feature internal-api only.
Source§

impl RowVisitor for RemoveVisitor

Available on crate feature internal-api only.
Source§

impl RowVisitor for SetTransactionVisitor

Available on crate feature internal-api only.
Source§

impl RowVisitor for SidecarVisitor

Available on crate feature internal-api only.