Overview
With Arrow Flight SQL protocol, you can execute normal DDL, DML, DQL statements, and use Python code or Java code to read large-scale data via Arrow Flight SQL ADBC or JDBC driver. This solution establishes a fully columnar data transfer pipeline from the database columnar execution engine to the client, eliminating the frequent row-column conversions and serialization overhead typically seen in traditional JDBC and ODBC interfaces. This enables the database to transfer data with zero-copy, low latency, and high throughput.Scenarios
The Arrow Flight SQL integration makes the database especially well-suited for:- Data science workflows, where tools like Pandas and Apache Arrow expect columnar data.
- Data lake analytics, requiring high-throughput, low-latency access to massive datasets.
- Machine learning, where fast iteration and processing speed are critical.
- Real-time analytics platforms, that must deliver data with minimal delays.
- End-to-end columnar data transfer, eliminating costly conversions between columnar and row-based formats.
- Zero-copy data movement, reducing CPU and memory overhead.
- Low latency and extremely high throughput, accelerating analysis and responsiveness.
Technical approach
Traditionally, the database organizes query results in a columnar Block structure internally. However, when using JDBC, ODBC, or MySQL protocols, data must be:- Serialized into row-based bytes on the server.
- Transferred over the network.
- Deserialized back into a target structure (often requiring re-conversion to columnar formats).
- High serialization/deserialization overhead.
- Complex data transformations.
- Latency that grows with data volume.
- Retaining columnar format end-to-end, from the database execution engine directly to the client.
- Leveraging Apache Arrow’s in-memory columnar representation, which is optimized for analytics workloads.
- Using Arrow Flight’s protocol for high-speed transport, enabling efficient streaming without intermediate conversions.

Performance Comparison
Comprehensive tests demonstrate significant improvements in data retrieval speed. Across various data types (integer, float, string, boolean, and mixed columns), Arrow Flight SQL consistently outperformed traditional PyMySQL and Pandasread_sql interfaces. Key results include:
- For reading 10 million integer rows, execution time dropped from ~35 seconds to 0.4 seconds (~85× faster).
- For a mixed-column table, performance improvements reached 160× acceleration.
- Even in less complex queries (e.g., single string columns), performance gains exceeded 12×.
- 20× to 160× faster transfer times, depending on query complexity and data type.
- A clear reduction in CPU and memory usage due to the elimination of redundant serialization steps.
VectorSchemaRoot consumption, Parquet writers — and the measured speedup of each tuning step over MySQL JDBC, see Arrow Flight SQL Best Practices.
Usage
Follow these steps to connect to and interact with the database using Python ADBC Driver via Arrow Flight SQL protocol. Refer to Appendix for the complete code example. Note Python 3.9 or later is a prerequisite.Step 1. Install libraries
Usepip to install adbc_driver_manager and adbc_driver_flightsql from PyPI:
- Required libraries:
- Optional modules for better usability and debugging:
Step 2. Connect to the database
Note-
If you want to start the FE service using command line, you can use the either of the following ways:
-
Specify the environment variable
JAVA_TOOL_OPTIONS. -
Specify the FE configuration item
JAVA_OPTSin fe.conf. This way, you can append otherJAVA_OPTSvalues.
-
Specify the environment variable
-
If you want to run the service in IntelliJ IDEA, you must add the following option to
Build and runinRun/Debug Configurations:
Configure the database
Before connecting to the database via Arrow Flight SQL, you must first configure the FE and BE nodes to ensure that the Arrow Flight SQL service is enabled and listening on the specified ports. In both FE configuration file fe.conf and BE configuration file be.conf, setarrow_flight_port to an available port. After modifying the configuration files, restart FE and BE services to allow the modification to take effect.
Note
You must set different arrow_flight_port for FE and BE.
Example:
Configure Arrow Flight Proxy (Optional)
If your BE nodes are not directly accessible from client applications (for example, when deployed in private networks or Kubernetes environments), you can enable the Arrow Flight proxy feature on the FE to route data from BE nodes through the FE. The proxy feature is controlled by two global variables:arrow_flight_proxy_enabled: Controls whether proxy mode is enabled. Default istrue. When enabled, there is a slight performance overhead.arrow_flight_proxy: Specifies the proxy hostname. If empty (default), the current FE node acts as the proxy. You can set this to a specific hostname if using a different proxy endpoint.
- The proxy feature is enabled by default, which may result in 8-10% lower throughput compared to direct BE connections. If your clients have direct network access to BE nodes, or you have limited memory resources on the FE side, you can disable the proxy to achieve optimal performance:
SET GLOBAL arrow_flight_proxy_enabled = false;. - When
arrow_flight_proxyis empty, tickets will automatically route through the FE node that the client initially connected to. - Important: The
arrow_flight_proxyandarrow_flight_proxy_enabledsettings should be configured globally usingSET GLOBAL. Session-level settings are not supported. - Session restart required: Changing the proxy settings only affects new sessions. Existing Arrow Flight SQL sessions will continue using their original settings until they reconnect.
Establish connection
On the client side, create an Arrow Flight SQL client using the following information:- Host address of the database FE
- Port that Arrow Flight used for listening on the database FE
- Username and password of the user that has the necessary privileges
USERNAME and PASSWORD:
exp passes, the connection is refused and the client has to connect again with a new token. See Where each authentication method works.
Example:
Step 3. (Optional) Predefine utility functions
These functions are used to format the output, standardize the format, and simplify debugging. You can optionally define them in your code for testing.Step 4. Interact with the database
This section will guide you through some basic operations, such as creating a table, loading data, checking table metadata, setting variables, and running queries. Note The examples of output listed below are implemented based on the optional modules and utility functions described in the preceding steps.-
Create a database and a table where the data will be loaded, and check the table schema.
Example output:
-
Insert data, run some queries, and set variables.
Example output:
Step 5. Close connection
Include the following section in your code to close the connection.Use cases of large-scale data transfer
Python
After connecting to the database (with Arrow Flight SQL support) via the ADBC Driver in Python, you can use various ADBC APIs to load the Clickbench dataset from the database into Python. Code example:Arrow Flight SQL JDBC Driver
The Arrow Flight SQL protocol provides an open-source JDBC driver that is compatible with the standard JDBC interface. You can easily integrate it into various BI tools (such as Tableau, Power BI, DBeaver, etc.) to access the database, just as you would with a traditional JDBC driver. A significant advantage of this driver is its support for high-speed data transfer based on Apache Arrow, which greatly improves the efficiency of query and data transmission. The usage is almost identical to that of a traditional MySQL JDBC driver. You only need to replacejdbc:mysql with jdbc:arrow-flight-sql in the connection URL to seamlessly switch. The query results are still returned in the standard ResultSet format, ensuring compatibility with existing JDBC processing logic.
Note
Note that if you are using Java 9 or later, you must add --add-opens=java.base/java.nio=ALL-UNNAMED to your Java code to expose the internal structure of the JDK. Otherwise, you may encounter certain errors.
-
If you want to start the FE service using command line, you can use the either of the following ways:
-
Specify the environment variable
JAVA_TOOL_OPTIONS. -
Specify the FE configuration item
JAVA_OPTSin fe.conf. This way, you can append otherJAVA_OPTSvalues.
-
Specify the environment variable
-
If you want to debug in IntelliJ IDEA, you must add the following option to
Build and runinRun/Debug Configurations:

Java ADBC Driver
The Arrow Flight SQL protocol provides an open-source JDBC driver that is compatible with the standard JDBC interface. You can easily integrate it into various BI tools (such as Tableau, Power BI, DBeaver, etc.) to access the database, just as you would with a traditional JDBC driver. A significant advantage of this driver is its support for high-speed data transfer based on Apache Arrow, which greatly improves the efficiency of query and data transmission. The usage is almost identical to that of a traditional MySQL JDBC driver. Note-
If you want to start the FE service using command line, you can use the either of the following ways:
-
Specify the environment variable
JAVA_TOOL_OPTIONS. -
Specify the FE configuration item
JAVA_OPTSin fe.conf. This way, you can append otherJAVA_OPTSvalues.
-
Specify the environment variable
-
If you want to debug in IntelliJ IDEA, you must add the following option to
Build and runinRun/Debug Configurations:
Recommendations
-
Among the three Java Arrow Flight SQL connection methods mentioned above:
- If subsequent data analysis relies on row-based data formats, it is recommended to use
jdbc:arrow-flight-sql, which returns data in the JDBC ResultSet format. - If the analysis can directly process Arrow format or other columnar data formats, you can use the Flight AdbcDriver or Flight JdbcDriver. These options return Arrow-formatted data directly, avoiding row-column conversion and leveraging Arrow’s features to accelerate data parsing.
- If subsequent data analysis relies on row-based data formats, it is recommended to use
-
Regardless of whether you parse JDBC ResultSet or Arrow-formatted data, the parsing time is often longer than the time spent reading the data itself. If you find that Arrow Flight SQL does not deliver the expected performance improvement over
jdbc:mysql://, consider investigating whether data parsing takes too long. - For all connection methods, data reading with JDK 17 is generally faster than with JDK 1.8.
-
When reading large-scale datasets, Arrow Flight SQL typically consumes less memory compared to
jdbc:mysql://. Therefore, if you are experiencing memory constraints, it is also worth trying Arrow Flight SQL. - In addition to the three connection methods above, you can also use the native FlightClient to connect to the Arrow Flight Server, enabling more flexible parallel reading from multiple endpoints. The Java Flight AdbcDriver is built on top of FlightClient and provides a simpler interface compared to using FlightClient directly.
Spark
Currently, the official Arrow Flight project has no plans to support Spark or Flink. In the future, support will be gradually added to allow starrocks-spark-connector to access the database via Arrow Flight SQL, with expected read performance improvements several times. When accessing the database with Spark, in addition to the traditional JDBC or Java client methods, you can also use the open-source Spark-Flight-Connector component to directly read from and write to the database Flight SQL Server as a Spark DataSource. This approach, based on the Apache Arrow Flight protocol, offers the following significant advantages:- High-performance data transfer Spark-Flight-Connector uses Apache Arrow as the data transfer format, enabling zero-copy, highly efficient data exchange. The conversion between the database’
internal Blockdata format and Arrow is highly efficient, achieving performance improvements of up to 10 times compared to traditionalCSVorJDBCmethods, and significantly reducing data transfer overhead. - Native support for complex data types The Arrow data format natively supports complex types (such as
Map,Array,Struct, etc.), enabling better adaptation to the database’ complex data models compared to traditional JDBC methods, and enhancing data expressiveness and compatibility. - Support for read, write, and streaming write The component supports Spark as a Flight SQL client for efficient read and write operations, including
insert,merge,update, anddeleteDML statements, and even supports streaming write, making it suitable for real-time data processing scenarios. - Support for predicate pushdown and column pruning When reading data, Spark-Flight-Connector supports predicate pushdown and column pruning, enabling data filtering and column selection on the database side, significantly reducing the amount of data transferred and improving query performance.
- Support for aggregation pushdown and parallel read Aggregation operations (such as
sum,count,max,min, etc.) can be pushed down to the database for execution, reducing the computational load on Spark. Parallel reading based on partitioning is also supported, improving read efficiency in large data scenarios. - Better for big data scenarios Compared to traditional JDBC methods, the Flight SQL protocol is better suited for large-scale, high concurrency access scenarios, enabling the database to fully leverage its high-performance analytical capabilities.