You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that most examples return data in a row-by-row format.
Is there a way to get it in batches instead?🤔
For example, something like this process could retrieve an arrow formatted batch:
use clickhouse::Client;use tokio;use arrow::ipc::reader::StreamReader;use std::io::Cursor;#[tokio::main]asyncfnmain() -> Result<(),Box<dyn std::error::Error>>{// Creating a ClickHouse Clientlet client = Client::default().with_url("http://localhost:8123").with_database("default").with_user("default").with_password("");// Execute a query and get the data in Arrow IPC formatlet response = client.query("SELECT id, name, value FROM my_table FORMAT ArrowStream").fetch_raw().await?;// Convert response data to Arrow StreamReaderlet cursor = Cursor::new(response);letmut reader = StreamReader::try_new(cursor)?;// Processing Arrow batch datawhileletSome(batch) = reader.next(){let batch = batch?;println!("{:?}", batch);}println!("Arrow IPC read completed.");Ok(())}
The text was updated successfully, but these errors were encountered:
I've noticed that most examples return data in a row-by-row format.
Is there a way to get it in batches instead?🤔
For example, something like this process could retrieve an arrow formatted batch:
The text was updated successfully, but these errors were encountered: