Skip to main content

SchemaEvolvable

Trait SchemaEvolvable 

Source
pub trait SchemaEvolvable: Send + Sync {
    // Required methods
    fn diff_schemas(
        &self,
        old: &SchemaRef,
        new: &SchemaRef,
    ) -> Vec<SchemaChange>;
    fn evaluate_evolution(&self, changes: &[SchemaChange]) -> EvolutionVerdict;
    fn apply_evolution(
        &self,
        old: &SchemaRef,
        changes: &[SchemaChange],
    ) -> SchemaResult<ColumnProjection>;

    // Provided method
    fn schema_version(&self) -> Option<u32> { ... }
}
Expand description

A connector that supports schema evolution.

Provides diffing, evaluation, and application of schema changes.

Required Methods§

Source

fn diff_schemas(&self, old: &SchemaRef, new: &SchemaRef) -> Vec<SchemaChange>

Computes the differences between two schemas.

Source

fn evaluate_evolution(&self, changes: &[SchemaChange]) -> EvolutionVerdict

Evaluates whether a set of schema changes is acceptable.

Source

fn apply_evolution( &self, old: &SchemaRef, changes: &[SchemaChange], ) -> SchemaResult<ColumnProjection>

Applies schema changes, returning a column projection that maps old data to the new schema.

§Errors

Returns a schema error if the evolution cannot be applied.

Provided Methods§

Source

fn schema_version(&self) -> Option<u32>

Returns the current schema version, if tracked.

Implementors§