pub enum PipelineOutput {
Rows(Vec<Row>),
Batch(ColumnarBatch),
Empty,
}Expand description
Polymorphic output from pipeline stages.
Output can be in row or columnar batch format, allowing efficient chaining of pipeline stages with format-appropriate optimizations.
§Example
use vibesql_executor::pipeline::PipelineOutput;
// Row-based output
let output = PipelineOutput::from_rows(rows);
let rows = output.into_rows(); // Zero-copy for Rows variant
// Columnar batch output
let output = PipelineOutput::from_batch(batch);
let rows = output.into_rows(); // Materializes batch to rowsVariants§
Rows(Vec<Row>)
Row-based output (traditional format)
Batch(ColumnarBatch)
Columnar batch output for SIMD-accelerated pipelines
This variant enables keeping data in columnar format throughout the pipeline for maximum performance.
Empty
Empty output (zero rows)
Implementations§
Source§impl PipelineOutput
impl PipelineOutput
Sourcepub fn from_batch(batch: ColumnarBatch) -> Self
pub fn from_batch(batch: ColumnarBatch) -> Self
Create output from a columnar batch.
Sourcepub fn into_rows(self) -> Vec<Row>
pub fn into_rows(self) -> Vec<Row>
Convert to rows, consuming the output.
This is the final conversion when returning results to the caller.
§Performance
Rows: Zero-copy move (O(1))Batch: Materializes to rows (O(n * m) where m = columns)Empty: Returns empty Vec (O(1))
Sourcepub fn as_rows(&self) -> Option<&[Row]>
pub fn as_rows(&self) -> Option<&[Row]>
Try to get rows as a slice (only works for Rows variant).
Returns None for Batch and Empty variants.
Sourcepub fn as_batch(&self) -> Option<&ColumnarBatch>
pub fn as_batch(&self) -> Option<&ColumnarBatch>
Try to get the columnar batch (only works for Batch variant).
Returns None for Rows and Empty variants.
Sourcepub fn into_batch(self) -> Option<ColumnarBatch>
pub fn into_batch(self) -> Option<ColumnarBatch>
Consume and return the columnar batch if this is a Batch variant.
Returns None for other variants.
Sourcepub fn into_input(self) -> PipelineInput<'static>
pub fn into_input(self) -> PipelineInput<'static>
Convert to PipelineInput for chaining pipeline stages.
This enables fluent chaining: filter().project().aggregate()
Preserves the data format (rows stay rows, batches stay batches).
Trait Implementations§
Source§impl Debug for PipelineOutput
impl Debug for PipelineOutput
Source§impl Default for PipelineOutput
impl Default for PipelineOutput
Source§fn default() -> PipelineOutput
fn default() -> PipelineOutput
Auto Trait Implementations§
impl Freeze for PipelineOutput
impl RefUnwindSafe for PipelineOutput
impl Send for PipelineOutput
impl Sync for PipelineOutput
impl Unpin for PipelineOutput
impl UnwindSafe for PipelineOutput
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
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