pub struct RowBatch {
pub column_names: Arc<[Arc<str>]>,
pub column_types: Arc<[DataTypeNode]>,
pub column_data: Vec<Vec<Value>>,
pub num_rows: usize,
}Available on crate feature
sea-ql only.Expand description
A column-oriented batch of dynamically-typed rows.
Instead of one sea_query::Value vector per row (as in DataRow),
RowBatch stores one Vec<Value> per column. This layout is efficient
for columnar processing and is the natural precursor to Apache Arrow
record batches.
All column_data vectors have exactly num_rows entries.
Obtain batches via crate::query::DataRowCursor::next_batch.
§Example
ⓘ
let mut cursor = client
.query("SELECT number, toString(number) AS s FROM system.numbers LIMIT 100")
.fetch_rows()?;
while let Some(batch) = cursor.next_batch(32).await? {
println!("{} rows, {} columns", batch.num_rows, batch.column_names.len());
for (name, col) in batch.column_names.iter().zip(&batch.column_data) {
println!(" {name}: {} values", col.len());
}
}Fields§
§column_names: Arc<[Arc<str>]>Column names in schema order, shared with all other batches from the same query.
column_types: Arc<[DataTypeNode]>ClickHouse data types in schema order, shared with all other batches from the same query.
column_data: Vec<Vec<Value>>Per-column value vectors; column_data[i] holds all values for column_names[i].
Every inner Vec has exactly num_rows entries.
num_rows: usizeNumber of rows in this batch.
Trait Implementations§
impl StructuralPartialEq for RowBatch
Auto Trait Implementations§
impl Freeze for RowBatch
impl RefUnwindSafe for RowBatch
impl Send for RowBatch
impl Sync for RowBatch
impl Unpin for RowBatch
impl UnsafeUnpin for RowBatch
impl UnwindSafe for RowBatch
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