Integrating with Databricks
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:
An active Databricks admin account, in a workspace that uses Unity Catalog. Drivetrain lists your tables through Unity Catalog.
At least one SQL warehouse. Drivetrain runs its queries on a SQL warehouse, so an all-purpose compute cluster can't be used.
Admin access in Drivetrain.
Databricks Guide
Step 1: Create Personal Access Token
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.
In your Databricks workspace, click your Databricks username in the top bar, and then select Settings from the drop down.
Click Developer.
Next to Access tokens, click Manage.
Click Generate new token.
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
sqlandunity-catalogscopes: Drivetrain runs SQL statements and reads Unity Catalog. Syncs fail once the token expires, so pick a lifetime that fits.Click Generate.
Copy the displayed token to a secure location, and then click Done.
Step 2: Create and Connect a new SQL Warehouse
In the Databricks console, go to SQL > SQL warehouses > Create SQL warehouse

In the New SQL warehouse window, enter a Name for your warehouse
Choose your Cluster Size and configure the other warehouse options
Click Create

After creating the warehouse, Go to the Connection details tab

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
In the sidebar, under SQL, click SQL Warehouses and open your warehouse.
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.
Each sync reads the selected tables in full and replaces the copy in Drivetrain.
Last updated
Was this helpful?