Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Connecting Python and Apache Doris with ADBC

Instructions

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.

Prerequisites

  1. Install uv

  2. Install dbc

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.

  1. Install Docker

  2. Download the Apache Doris quick-start script:

    curl -O https://doris.apache.org/files/start-doris.sh
  3. Add Flight SQL ports and configure the backend to advertise localhost:

    sed -i.bak -f patch-doris.sed start-doris.sh
  4. Start an Apache Doris cluster:

    chmod 755 start-doris.sh
    ./start-doris.sh

Connect to Apache Doris

  1. Install the Flight SQL ADBC driver:

    dbc install flightsql
  2. Customize the Python script main.py as needed.

    • Change the connection arguments in db_kwargs.
      • uri is the URI of your Apache Doris instance. The host and FE Arrow Flight SQL port will depend on your installation.
      • username and password are the username and password of your Apache Doris user.
    • Change the SQL SELECT statement in cursor.execute() if desired.
  3. Run the Python script:

    uv run main.py

Clean up

Stop the Docker project running Apache Doris:

docker compose -f docker-compose-doris.yaml down