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 aFlightInfowith one or more endpoints.DoGet— fetch result data asRecordBatchstream.DoPut— pushRecordBatchdata into a flight (used forINSERT).DoExchange— bidirectionalRecordBatchexchange.
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 --> ClientInternally 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
Handshakeflow.
Use cases
- Polars:
pl.read_databasewith 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.
Related pages
- Server protocols
- Formats —
Arrow,ArrowStream,Parquet.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.