Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Integrating with Databricks

Prerequisites

Databricks Guide Create Personal Access Token Create and Connect a new SQL Warehouse Connect an existing SQL warehouse Grant access

Prerequisites

To connect Databricks to Drivetrain, you need:

  1. An active Databricks admin account, in a workspace that uses Unity Catalog. Drivetrain lists your tables through Unity Catalog.

  2. At least one SQL warehouse. Drivetrain runs its queries on a SQL warehouse, so an all-purpose compute cluster can't be used.

  3. Admin access in Drivetrain.

Databricks Guide

Step 1: Create Personal Access Token

  1. Drivetrain uses a secure token to connect to Databricks. You can read more about the Databricks token management guide here. If Drivetrain asks how you'd like to connect to Databricks, you can instead choose OAuth (M2M) and connect with a service principal: create one, generate an OAuth secret (client ID and client secret) for it, and grant it the access in Step 4.

  2. In your Databricks workspace, click your Databricks username in the top bar, and then select Settings from the drop down.

  3. Click Developer.

  4. Next to Access tokens, click Manage.

  5. Click Generate new token.

  6. Enter a name that helps you identify this token later, and set its lifetime in days. If asked for a scope type, choose Other APIs and include the sql and unity-catalog scopes: Drivetrain runs SQL statements and reads Unity Catalog. Syncs fail once the token expires, so pick a lifetime that fits.

  7. Click Generate.

  8. Copy the displayed token to a secure location, and then click Done.

Step 2: Create and Connect a new SQL Warehouse

  1. In the Databricks console, go to SQL > SQL warehouses > Create SQL warehouse

  1. In the New SQL warehouse window, enter a Name for your warehouse

  2. Choose your Cluster Size and configure the other warehouse options

  3. Click Create

  1. After creating the warehouse, Go to the Connection details tab

  1. Make a note of the Server Hostname and HTTP Path and keep them in the secured location along with the personal access token.

Step 3: Connect an existing SQL warehouse

  1. In the sidebar, under SQL, click SQL Warehouses and open your warehouse.

  2. On the Connection details tab, make a note of the Server Hostname and HTTP Path.

Step 4: Grant access

The user who owns the token (or the service principal) needs CAN USE on the SQL warehouse, and read access to the tables you want to sync:

Drivetrain only reads your tables. It doesn't need MODIFY or any write permission.

That’s it. Now connect Databricks in Drivetrain:

  1. Go to Data in the left navigation, click the + button and select Databricks.

  2. Enter the details below in the form and click Submit.

  3. If Drivetrain instead asks how you'd like to connect to Databricks, choose Personal Access Token, enter the same details and click Submit.

  4. Once the connection is set up, open it and click Add data to choose the tables to sync.

Each sync reads the selected tables in full and replaces the copy in Drivetrain.

Last updated

Was this helpful?