pub struct RecordBatch { /* private fields */ }Expand description
A batch of rows, as Arrow columns.
Implementations§
Source§impl RecordBatch
impl RecordBatch
Sourcepub fn of(chunk: &Chunk, names: &[String]) -> Result<Self>
pub fn of(chunk: &Chunk, names: &[String]) -> Result<Self>
The batch a chunk becomes, with these column names.
The names come from the caller because a chunk does not have any. A chunk is a run of vectors and the names live on whatever produced it, which for a query result is the plan’s output list and for a table scan is the catalog.
§Errors
When the number of names is not the number of columns, and for anything Array::of
rejects.
Sourcepub fn empty(schema: Schema) -> Result<Self>
pub fn empty(schema: Schema) -> Result<Self>
An empty batch of this schema.
A result with no rows still has columns, and a consumer that reads the schema off the first batch needs one to read it off. Every array in it has length zero, which is a validity bitmap of nothing and a values buffer of nothing.
§Errors
Never, today. It returns a result so that a schema carrying a type with no empty array later has somewhere to say so.
Trait Implementations§
Source§impl Clone for RecordBatch
impl Clone for RecordBatch
Source§fn clone(&self) -> RecordBatch
fn clone(&self) -> RecordBatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more