Skip to main content

execute_stream_arrow_with_params

Function execute_stream_arrow_with_params 

Source
pub fn execute_stream_arrow_with_params(
    query: &str,
    params: impl Into<QueryParams>,
) -> Result<ArrowQueryStream<'static>>
Expand description

Execute a one-off query with ClickHouse {name:Type} parameter binding and stream Arrow batches.

Counterpart to execute_stream_arrow. Syntax errors fail when the stream is created. A missing placeholder binding is reported on the first ArrowQueryStream::next_batch, not at start.

§Examples

use chdb_rust::execute_stream_arrow_with_params;

let mut stream =
    execute_stream_arrow_with_params("SELECT {x:UInt64} AS v", [("x", 11_u64)])?;
while let Some(batch) = stream.next_batch()? {
    println!("rows: {}", batch.num_rows());
}

§Errors

This function will return an error if:

  • The query syntax is invalid
  • The connection cannot be established
  • The query cannot be started
  • A connection is already open on a data path. See Error::PathConflict.