Skip to main content

BatchSink

Trait BatchSink 

Source
pub trait BatchSink {
    // Required methods
    fn on_schema(&mut self, schema: SchemaRef) -> Result<()>;
    fn on_batch(&mut self, batch: &RecordBatch) -> Result<()>;

    // Provided method
    fn set_source_cursor(&mut self, _token: String) { ... }
}
Expand description

Receives schema and batches from a source, one at a time.

Required Methods§

Source

fn on_schema(&mut self, schema: SchemaRef) -> Result<()>

Source

fn on_batch(&mut self, batch: &RecordBatch) -> Result<()>

Provided Methods§

Source

fn set_source_cursor(&mut self, _token: String)

A source whose key type is richer than its output column can express reports its own keyset high-water mark here, as a lossless, engine-decodable token. The keyset/parallel runners prefer it over the string extracted from the output column — this is how MongoDB pages by a non-ObjectId BSON _id (int, string, …) whose hex/text rendering in the _id column would be type-ambiguous on the round-trip. No-op default: SQL engines carry their cursor losslessly in the column already.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§