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§
Sourcefn selected_column_names_and_types(
&self,
) -> (&'static [ColumnName], &'static [DataType])
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.
Sourcefn visit<'a>(
&mut self,
row_count: usize,
getters: &[&'a dyn GetData<'a>],
) -> DeltaResult<()>
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§
Sourcefn visit_rows_of(&mut self, data: &dyn EngineData) -> DeltaResult<()>where
Self: Sized,
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§
impl RowVisitor for AddVisitor
internal-api only.impl RowVisitor for CdcVisitor
internal-api only.impl RowVisitor for CheckpointVisitor
adaptive-metadata-in-dev and internal-api only.impl RowVisitor for MetadataVisitor
internal-api only.impl RowVisitor for ProtocolVisitor
internal-api only.impl RowVisitor for RemoveVisitor
internal-api only.impl RowVisitor for SetTransactionVisitor
internal-api only.impl RowVisitor for SidecarVisitor
internal-api only.