Open-Source Wikis

/

ClickHouse

/

API

/

Arrow Flight

clickhouse/clickhouse

Arrow Flight

ClickHouse supports Apache Arrow Flight RPC, an Arrow-native streaming protocol. Default port: 9006. Implementation: src/Server/ArrowFlightHandler.cpp and src/Server/ArrowFlightHandlerFactory.cpp.

Arrow Flight uses gRPC underneath but speaks Arrow RecordBatch natively, so consumer libraries (PyArrow, Polars, Spark, DuckDB, …) get zero-copy columnar data streams.

Endpoints

The standard Arrow Flight verbs are exposed:

  • Handshake — auth handshake.
  • ListFlights — enumerate available flights (limited in ClickHouse: a flight is one query).
  • GetFlightInfo — submit a query, get a FlightInfo with one or more endpoints.
  • DoGet — fetch result data as RecordBatch stream.
  • DoPut — push RecordBatch data into a flight (used for INSERT).
  • DoExchange — bidirectional RecordBatch exchange.

Data path

graph LR
    Client[PyArrow / Polars client] -- GetFlightInfo --> Server[ClickHouse Arrow Flight handler]
    Server -- FlightInfo (endpoint + ticket) --> Client
    Client -- DoGet (ticket) --> Server
    Server -- RecordBatch stream --> Client

Internally the handler builds a query pipeline and feeds output blocks into Arrow's RecordBatchWriter, leveraging the existing Arrow output format from src/Processors/Formats/Impl/ArrowBlockOutputFormat.cpp.

Auth

  • mTLS (configured via the <openSSL> block).
  • Bearer tokens via the Handshake flow.

Use cases

  • Polars: pl.read_database with a Flight URI.
  • DuckDB: arrow_scan('flight://...').
  • Spark: org.apache.arrow.flight.spark.
  • Custom analytics tools that consume Arrow without the cost of decoding Parquet/JSON.

Limitations

  • Schema needs to match the engine's output. Variant/Dynamic types may be down-cast to JSON-typed columns.
  • Some client libraries assume Arrow IPC over Flight; ClickHouse's implementation matches that assumption.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Arrow Flight – ClickHouse wiki | Factory