Trait datafusion::physical_plan::insert::DataSink

source ·
pub trait DataSink: DisplayAs + Debug + Send + Sync {
    // Required methods
    fn as_any(&self) -> &(dyn Any + 'static);
    fn metrics(&self) -> Option<MetricsSet>;
    fn write_all<'life0, 'life1, 'async_trait>(
        &'life0 self,
        data: Pin<Box<dyn RecordBatchStream<Item = Result<RecordBatch, DataFusionError>> + Send>>,
        context: &'life1 Arc<TaskContext>
    ) -> Pin<Box<dyn Future<Output = Result<u64, DataFusionError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
}
Expand description

DataSink implements writing streams of RecordBatches to user defined destinations.

The Display impl is used to format the sink for explain plan output.

Required Methods§

source

fn as_any(&self) -> &(dyn Any + 'static)

Returns the data sink as Any so that it can be downcast to a specific implementation.

source

fn metrics(&self) -> Option<MetricsSet>

Return a snapshot of the MetricsSet for this DataSink.

See ExecutionPlan::metrics() for more details

source

fn write_all<'life0, 'life1, 'async_trait>( &'life0 self, data: Pin<Box<dyn RecordBatchStream<Item = Result<RecordBatch, DataFusionError>> + Send>>, context: &'life1 Arc<TaskContext> ) -> Pin<Box<dyn Future<Output = Result<u64, DataFusionError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Writes the data to the sink, returns the number of values written

This method will be called exactly once during each DML statement. Thus prior to return, the sink should do any commit or rollback required.

Implementors§