pub struct ArrowBatchBuilder { /* private fields */ }Expand description
Incremental Arrow RecordBatch builder.
Rows are pushed one at a time via push_row. Call
finish to produce a RecordBatch and reset the builder.
The builder validates that each row’s length matches the schema.
Implementations§
Source§impl ArrowBatchBuilder
impl ArrowBatchBuilder
Sourcepub fn new(schema: SchemaRef) -> Result<Self, ArrowError>
pub fn new(schema: SchemaRef) -> Result<Self, ArrowError>
Create a new builder for the given schema.
Returns an error if the schema contains unsupported data types.
Sourcepub fn push_row(&mut self, values: &[ArrowValue]) -> Result<(), ArrowError>
pub fn push_row(&mut self, values: &[ArrowValue]) -> Result<(), ArrowError>
Append a row of values.
Returns ArrowError::SchemaError if the row length doesn’t match
the schema, or if a value type doesn’t match its column’s data type.
Sourcepub fn finish(&mut self) -> Result<RecordBatch, ArrowError>
pub fn finish(&mut self) -> Result<RecordBatch, ArrowError>
Consume the accumulated rows and produce a RecordBatch.
The builder is reset and can be reused for the next batch.
Auto Trait Implementations§
impl Freeze for ArrowBatchBuilder
impl !RefUnwindSafe for ArrowBatchBuilder
impl Send for ArrowBatchBuilder
impl Sync for ArrowBatchBuilder
impl Unpin for ArrowBatchBuilder
impl UnsafeUnpin for ArrowBatchBuilder
impl !UnwindSafe for ArrowBatchBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more