Skip to main content

execute_pipeline_streaming

Function execute_pipeline_streaming 

Source
pub fn execute_pipeline_streaming<I>(
    rows: I,
    stages: &[String],
) -> Result<OutputResult>
where I: IntoIterator<Item = Row>, I::IntoIter: 'static,
Expand description

Execute a pipeline from any row iterator.

This keeps flat row stages on an iterator-backed path until a stage requires full materialization (for example sort/group/aggregate/jq).

Use this when rows come from an iterator and you want streamable stages like F, P, U, and head-only L to stay incremental for as long as possible.

ยงExamples

use osp_cli::dsl::execute_pipeline_streaming;
use osp_cli::row;

let output = execute_pipeline_streaming(
    vec![
        row! { "uid" => "alice" },
        row! { "uid" => "bob" },
    ],
    &["L 1".to_string()],
)?;

assert_eq!(output.as_rows().unwrap()[0]["uid"], "alice");
assert_eq!(output.as_rows().unwrap().len(), 1);