This example uses Sail, a fast query engine that supports Arrow Flight SQL.
Tip
If you already have a Sail Flight SQL server running, skip the steps to set up Sail.
-
Install Sail:
uv tool install pysail
-
Start the Sail Flight SQL server:
sail flight server --ip 127.0.0.1 --port 32010
-
Install the Flight SQL ADBC driver:
dbc install flightsql
-
Customize the
mainmethod inExample.java- Change the connection arguments in the
params.put()callsuriis the URI of your Sail Flight SQL server. The host and port will depend on your installation (the default port is 32010). The protocol scheme should begrpcfor plain connections orgrpc+tlsif your server is configured with TLS.
- Change the SQL SELECT statement in
stmt.setSqlQuery()if desired
- Change the connection arguments in the
-
Run the Java program:
mvn compile exec:exec
The output will look something like this:
result 2
Stop the Sail Flight SQL server by pressing Ctrl-C in the terminal where it is running.