pub struct TableBuilder { /* private fields */ }Expand description
Generic columnar table builder. Implements ColumnarSink so any decoder
can feed it field/value events; at the end it produces an Arrow
RecordBatch.
Implementations§
Source§impl TableBuilder
impl TableBuilder
pub fn new() -> Self
pub fn with_capacity(cap: usize) -> Self
pub fn with_plan(cap: usize, plan: ExecutionPlan) -> Self
pub fn num_rows(&self) -> usize
pub fn num_columns(&self) -> usize
pub fn column_names(&self) -> &[String]
Sourcepub fn finish(&mut self) -> Result<RecordBatch>
pub fn finish(&mut self) -> Result<RecordBatch>
Finalize the builder into an Arrow RecordBatch.
This is also available as the ColumnarSink::finish trait method.
Sourcepub fn normalize(&mut self)
pub fn normalize(&mut self)
Truncate every column back to row_count, dropping any partial-row
values from a mid-field EOF. Idempotent.
Sourcepub fn auto_dict_upgrade(&mut self)
pub fn auto_dict_upgrade(&mut self)
If auto_dict is set, upgrade low-cardinality string columns.
Sourcepub fn sort_columns(&mut self)
pub fn sort_columns(&mut self)
Sort columns according to schema_order. Columns named in
schema_order appear in that order; any other columns keep their
relative first-appearance order after the ordered ones.
Source§impl TableBuilder
impl TableBuilder
Sourcepub fn extend(&mut self, other: TableBuilder) -> Result<()>
pub fn extend(&mut self, other: TableBuilder) -> Result<()>
Merge another builder’s data into this one, consuming other.
New columns discovered in other are null-padded for the existing rows
in self. Columns present in self but absent from other are
null-padded for other’s rows. Column order follows first-appearance
order across both builders.
Trait Implementations§
Source§impl ColumnarSink for TableBuilder
impl ColumnarSink for TableBuilder
fn begin_row(&mut self)
fn put_field(&mut self, name: &str, value: Value<'_>)
fn end_row(&mut self)
Source§fn wants(&self, name: &str) -> bool
fn wants(&self, name: &str) -> bool
false to signal that the engine will drop this field.Source§fn finish(&mut self) -> Result<RecordBatch>
fn finish(&mut self) -> Result<RecordBatch>
RecordBatch.Auto Trait Implementations§
impl Freeze for TableBuilder
impl RefUnwindSafe for TableBuilder
impl Send for TableBuilder
impl Sync for TableBuilder
impl Unpin for TableBuilder
impl UnsafeUnpin for TableBuilder
impl UnwindSafe for TableBuilder
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more