Buffering functions
On this page
Sink, combine, source — for output that depends on the whole input.
trait TableBufferingFunction
Section titled “trait TableBufferingFunction”pub trait TableBufferingFunction: Send + Sync { fn name(&self) -> &str; fn metadata(&self) -> FunctionMetadata; fn argument_specs(&self) -> Vec<ArgSpec>; fn secret_lookups(&self, _params: &BindParams) -> Vec<crate::secrets::SecretLookup> { Vec::new() } fn on_bind(&self, params: &BindParams) -> Result<BindResponse>; fn process( &self, params: &BufferingParams, batch: &arrow_array::RecordBatch, ) -> Result<Vec<u8>>; fn combine(&self, params: &BufferingParams, state_ids: &[Vec<u8>]) -> Result<Vec<Vec<u8>>>; fn finalize_producer( &self, params: &BufferingParams, finalize_state_id: Vec<u8>, ) -> Result<Box<dyn TableProducer>>;}Description
A table buffering (sink+source) function.
struct BufferingParams
Section titled “struct BufferingParams”pub struct BufferingParams { pub execution_id: Vec<u8>, pub storage: Arc<dyn FunctionStorage>, pub output_schema: SchemaRef, pub arguments: Arguments, pub settings: Settings, pub secrets: crate::secrets::Secrets, pub attach_opaque_data: Option<Vec<u8>>, pub batch_index: Option<i64>, pub copy_to: Option<crate::protocol::dtos::CopyToContext>, pub input_schema: Option<SchemaRef>, pub logs: Arc<std::sync::Mutex<Vec<String>>>,}Description
Parameters for buffering process / combine / finalize.
Methods
method log
Section titled “method log”pub fn log(&self, message: impl Into<String>)Queue an INFO-level client log line (surfaced under duckdb_logs()).