Skip to main content

Module arrow_stream

Module arrow_stream 

Source
Expand description

Arrow streaming support for chDB.

This module provides types and functions for registering Arrow streams and arrays as table functions in chDB, enabling efficient data transfer between Arrow and ClickHouse formats.

§Overview

Arrow streaming allows you to:

  • Register Arrow streams as virtual tables that can be queried with SQL
  • Register Arrow arrays as virtual tables
  • Unregister tables when done

§Examples

use chdb_rust::connection::Connection;
use chdb_rust::arrow_stream::{ArrowStream, ArrowSchema, ArrowArray};

// Create a connection
let conn = Connection::open_in_memory()?;

// Register an Arrow stream as a table (assuming you have an Arrow stream handle)
// let arrow_stream = ArrowStream::from_raw(stream_ptr);
// conn.register_arrow_stream("my_table", &arrow_stream)?;

// Query the registered table
// let result = conn.query("SELECT * FROM my_table", OutputFormat::JSONEachRow)?;

// Unregister when done
// conn.unregister_arrow_table("my_table")?;

Structs§

ArrowArray
A handle to an Arrow array.
ArrowSchema
A handle to an Arrow schema.
ArrowStream
A handle to an Arrow stream.