Skip to main content

Module arrow_stream

Module arrow_stream 

Source
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§

ArrowArray
A handle to an Arrow C Data Interface ArrowArray.
ArrowRegistration
A scoped, owned Arrow source registered with chDB’s process-wide registry.
ArrowSchema
A handle to an Arrow C Data Interface ArrowSchema.
ArrowStream
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§

RawArrowArray
Raw Arrow C Data Interface array pointer expected by chdb_arrow_array_scan.
RawArrowArrayStream
Raw Arrow C Data Interface stream pointer expected by chdb_arrow_scan.
RawArrowSchema
Raw Arrow C Data Interface schema pointer expected by chdb_arrow_array_scan.