Skip to main content

Transform

Trait Transform 

Source
pub trait Transform: Send + Sync {
    // Required method
    fn apply(
        &self,
        ctx: &TableContext,
        batches: &[RecordBatch],
    ) -> Result<GraphMutation>;

    // Provided method
    fn apply_deletes(
        &self,
        ctx: &TableContext,
        batches: &[RecordBatch],
    ) -> Result<GraphMutation> { ... }
}
Expand description

One step of a pipeline: table rows in, graph elements out.

Implement this for cases the declarative mappings can’t express, and register it under a name with crate::registry::TransformRegistry.

Required Methods§

Source

fn apply( &self, ctx: &TableContext, batches: &[RecordBatch], ) -> Result<GraphMutation>

Provided Methods§

Source

fn apply_deletes( &self, ctx: &TableContext, batches: &[RecordBatch], ) -> Result<GraphMutation>

The same step over a changelog round’s DELETE rows, whose nodes and edges are then removed. Such a row may carry only its key — every other column null — so a step that filters or computes on other columns must not let that drop the delete. The default is Self::apply, right for every step that only picks columns.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§