This example uses Apache Doris, a high-performance, real-time analytical database.
Tip
If you already have an Apache Doris instance running, skip the steps to set up Apache Doris.
Warning
This setup process has not been tested on Windows and might not work without modification. Windows users should run it under WSL.
-
Download the Apache Doris quick-start script:
curl -O https://doris.apache.org/files/start-doris.sh
-
Add Flight SQL ports and configure the backend to advertise
localhost:sed -i.bak -f patch-doris.sed start-doris.sh
-
Start an Apache Doris cluster:
chmod 755 start-doris.sh ./start-doris.sh
-
Install the Flight SQL ADBC driver:
dbc install flightsql
-
Customize the Python script
main.pyas needed.- Change the connection arguments in
db_kwargs.uriis the URI of your Apache Doris instance. The host and FE Arrow Flight SQL port will depend on your installation.usernameandpasswordare the username and password of your Apache Doris user.
- Change the SQL
SELECTstatement incursor.execute()if desired.
- Change the connection arguments in
-
Run the Python script:
uv run main.py
Stop the Docker project running Apache Doris:
docker compose -f docker-compose-doris.yaml down