Expand description
Arrow streaming support for chDB.
Registered streams are queried via the ClickHouse table function
ArrowStream('name'), not as bare table identifiers.
libchdb’s chdb_arrow_scan / chdb_arrow_array_scan take raw Arrow C Data
Interface pointers (ArrowArrayStream*, ArrowSchema*, ArrowArray*).
The chdb_arrow_* typedefs in chdb.h are misleading wrappers; pass pointers
to the actual FFI structs (e.g. from the arrow crate).
§Overview
Arrow streaming allows you to:
- Register Arrow streams as virtual table functions queryable with SQL
- Register Arrow schema+array pairs as one-shot streams
- Unregister names when done
§Examples
use chdb_rust::arrow_stream::{arrow_stream_table_sql, ArrowStream};
use chdb_rust::connection::Connection;
use chdb_rust::format::OutputFormat;
let conn = Connection::open_in_memory()?;
// Register an Arrow stream (assuming you have an Arrow C Data Interface handle)
// let arrow_stream = unsafe { ArrowStream::from_raw(stream_ptr) };
// conn.register_arrow_stream("my_data", &arrow_stream)?;
// Query via the ArrowStream table function, not a bare table name
// let sql = format!("SELECT * FROM {}", arrow_stream_table_sql("my_data"));
// let result = conn.query(&sql, OutputFormat::JSONEachRow)?;
// Unregister when done
// conn.unregister_arrow_table("my_data")?;Structs§
- Arrow
Array - A handle to an Arrow C Data Interface
ArrowArray. - Arrow
Registration - A scoped, owned Arrow source registered with chDB’s process-wide registry.
- Arrow
Schema - A handle to an Arrow C Data Interface
ArrowSchema. - Arrow
Stream - A handle to an Arrow C Data Interface
ArrowArrayStream.
Functions§
- arrow_
stream_ table_ sql - SQL table-expression for a registered Arrow stream name.
Type Aliases§
- RawArrow
Array - Raw Arrow C Data Interface array pointer expected by
chdb_arrow_array_scan. - RawArrow
Array Stream - Raw Arrow C Data Interface stream pointer expected by
chdb_arrow_scan. - RawArrow
Schema - Raw Arrow C Data Interface schema pointer expected by
chdb_arrow_array_scan.