RecordBatchBuffer

Trait RecordBatchBuffer 

Source
pub trait RecordBatchBuffer {
    // Required methods
    fn len(&self) -> usize;
    fn drain_to_record_batch(&mut self) -> Result<RecordBatch, ArrowError>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Trait for buffer types that can produce Arrow RecordBatches.

Auto-implemented by #[derive(RecordBatchRow)] from monarch_record_batch_macros.

Required Methods§

Source

fn len(&self) -> usize

Number of rows currently buffered.

Source

fn drain_to_record_batch(&mut self) -> Result<RecordBatch, ArrowError>

Drain buffered rows into a [RecordBatch].

After this call the buffer is empty (fields are consumed via std::mem::take). The only failure mode is Arrow schema/batch construction, so the error type is [ArrowError] rather than a catch-all.

Provided Methods§

Source

fn is_empty(&self) -> bool

Whether the buffer is empty.

Implementors§