Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.9 KB

File metadata and controls

53 lines (35 loc) · 1.9 KB

Connecting Python and Databricks with ADBC

Instructions

Prerequisites

  1. Install uv

  2. Install dbc

  3. Create a Databricks account or be able to log in to an existing one.

Set up Databricks

  1. Log into Databricks and create or locate an existing SQL warehouse.

  2. Open the "Connection details" tab and record the server hostname and HTTP path. See the Databricks documentation describing how to get these connection details.

Connect to Databricks

  1. Install the Databricks ADBC driver:

    dbc install databricks
  2. Customize the Python script main.py:

    • Change the connection arguments in db_kwargs:
    • Change the SQL SELECT statement in cursor.execute(), or keep it as is.
      • Specify the catalog and schema by fully qualifying the table name as catalog.schema.table.
  3. Run the Python script:

    uv run main.py