Skip to main content

EnvelopeHandler

Trait EnvelopeHandler 

Source
trait EnvelopeHandler: Send {
    // Required methods
    fn new(
        ctx: WriterContext,
        connection: &IcebergSinkConnection,
        materialize_arrow_schema: &Arc<ArrowSchema>,
    ) -> Result<Self>
       where Self: Sized;
    async fn create_writer(
        &self,
        is_snapshot: bool,
    ) -> Result<Box<dyn IcebergWriter>>;
    fn row_to_batch(
        &self,
        diff_pair: DiffPair<Row>,
        ts: Timestamp,
    ) -> Result<RecordBatch>;
}
Expand description

Envelope-specific logic for writing Iceberg data files.

Required Methods§

Source

fn new( ctx: WriterContext, connection: &IcebergSinkConnection, materialize_arrow_schema: &Arc<ArrowSchema>, ) -> Result<Self>
where Self: Sized,

Construct from the shared writer context after async setup completes.

Source

async fn create_writer( &self, is_snapshot: bool, ) -> Result<Box<dyn IcebergWriter>>

Create an IcebergWriter for a new batch.

is_snapshot is true for the initial “snapshot” batch (lower == as_of), which contains all pre-existing data and can be very large. Implementations may use this to disable memory-intensive optimisations like seen-rows deduplication.

Source

fn row_to_batch( &self, diff_pair: DiffPair<Row>, ts: Timestamp, ) -> Result<RecordBatch>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§