risingwave_connector::sink::formatter

Trait SinkFormatter

source
pub trait SinkFormatter {
    type K;
    type V;

    // Required method
    fn format_chunk(
        &self,
        chunk: &StreamChunk,
    ) -> impl Iterator<Item = Result<(Option<Self::K>, Option<Self::V>)>>;
}
Expand description

Transforms a StreamChunk into a sequence of key-value pairs according a specific format, for example append-only, upsert or debezium.

Required Associated Types§

source

type K

source

type V

Required Methods§

source

fn format_chunk( &self, chunk: &StreamChunk, ) -> impl Iterator<Item = Result<(Option<Self::K>, Option<Self::V>)>>

  • Key may be None so that messages are partitioned using round-robin. For example append-only without primary_key (aka downstream_pk) set.
  • Value may be None so that messages with same key are removed during log compaction. For example debezium tombstone event.

Object Safety§

This trait is not object safe.

Implementors§