Connect Databricks to Mammoth with a personal access token
The Databricks connector imports a table, or the result of your own SQL query, from a Databricks SQL warehouse into Mammoth as a dataset. It signs in with a personal access token (PAT) and reads one catalog per connection. Open it from Data Library > New dataset > Connectors and search for Databricks. Project Admins create the connection; Project Editors can start datasets from a connection the project already has.
What you can bring in from Databricks
- Any table in the connection's catalog that the token's user can read, grouped by schema.
- The result of your own SQL query.
Databricks doesn't offer Write SQL (AI query writing), so you write or edit SQL yourself. The dataset can refresh daily or only when you ask.
Before you connect Databricks
You need:
- A running Databricks SQL warehouse.
- A Databricks personal access token with access to the catalog you want to import from.
- The warehouse's HTTP Path, from Databricks → SQL Warehouses, then the warehouse, then Connection details.
- Your Databricks workspace Host URL and the Catalog Name you want to query.
- Mammoth's IP address added to your Databricks network configuration. See Allow Mammoth through your firewall.
A personal access token is the only supported sign-in. There's no OAuth or service-principal option. Generate a token from Databricks → User Settings → Developer → Access tokens, and note its expiry date: an expired token is the most common reason a Databricks connection stops working.
Find your Databricks HTTP Path
- In Databricks, go to SQL Warehouses.
- Select the warehouse you want to use.
- Open Connection details and copy the HTTP Path value exactly.
This field is specific to Databricks and the one most likely to trip up first-time users. It must come from a running SQL warehouse, not a cluster or job.
Connect Databricks to Mammoth
- Go to the Data Library, click New dataset, and choose Connectors.
- Search for Databricks and click its tile. The connection form opens.
- Fill in the fields below. A callout below the fields reminds you to whitelist Mammoth's IP address.
- Click Connect. If the check fails, the error appears at the bottom of the form.
- Once Mammoth has connected, the connector workspace opens on your tables. See Connect a database or app for the shared steps.
| Field | What to enter | Example |
|---|---|---|
| Host URL | Your Databricks workspace hostname | dbc-a1b2c3d4-e5f6.cloud.databricks.com |
| Port | Connection port | 443 (default) |
| HTTP Path | The SQL warehouse's connection endpoint | /sql/1.0/warehouses/a1b2c3d4e5f6g7h8 |
| Personal Access Token | Your Databricks PAT | |
| Catalog Name | The Unity Catalog to connect to, fixed for this connection | main |
| Display Name | Optional label for this connection in Mammoth | Databricks Production |
The form has no cluster picker: the HTTP Path decides which warehouse Mammoth queries. The Catalog Name is fixed per connection, so a different catalog needs a new connection.
Query a Databricks table in the SQL view
- In Tables, click a table. Mammoth opens its rows with the query that read them, in Databricks' backtick style:
SELECT * FROM `schema`.`table`. - To change the query, click Edit SQL, edit it, and click Run.
SELECT order_id, customer_id, amount, order_date
FROM `main`.`sales`.`orders`
WHERE order_date >= current_date() - INTERVAL 90 DAYS
AND status = 'completed'
Connect a database or app covers the full SQL view.
Save Databricks data as a dataset
- Click Save as dataset.
- Enter a Name and pick a folder.
- Under Keep it up to date, choose Daily at 06:00 or Only when I ask.
- Next to the sentence that says what each refresh does, click Change and pick an option under On each refresh (see the table below).
- Click Save as dataset.
| On each refresh | What it does |
|---|---|
| Replace all rows | Matches the source after every refresh |
| Add only new rows | Keeps what you have and adds rows above the last value of a Key column |
| Add every row again | Shown instead when the result has no numeric or date column, so each refresh adds a full copy |
| Keep only the newest rows | Empties the dataset, then brings in rows since the last refresh (needs a Key column) |
A key column is a column whose values only ever go up, such as an ID or a date.
Refresh Databricks data on a schedule
Choosing Daily at 06:00 creates a Dataset Refresh automation that you can reschedule later. After the dataset is saved, you can change what a refresh does in its Update method: Replace all data, Add new rows only or Keep only the newest rows.
Allow Mammoth in your Databricks network configuration
Add Mammoth's IP address to your Databricks workspace's allowed network configuration. Allow Mammoth through your firewall gives the current address and steps.
Troubleshoot Databricks token and connection errors
Personal access token is no longer valid
Mammoth shows "Authentication Failed, Your personal access token is no longer valid. Please check and update the token in the identity configuration." This is the most common error for this connector. Databricks tokens expire on a date your workspace administrator sets. To fix it:
- In Databricks, go to User Settings → Developer → Access tokens.
- Generate a new token, or check the expiry date on your existing one.
- In Mammoth, go to Data → Connections, open the connection, click Edit connection, and update the Personal Access Token.
Other Databricks problems
| Symptom | Likely cause | Fix |
|---|---|---|
| Connection fails with a valid token | The HTTP Path is wrong | Copy it from a running SQL warehouse's Connection details, not a cluster or job |
| Connection fails with a valid token | Mammoth's IP address isn't allowed | Whitelist it in your Databricks network configuration |
| No tables appear in a schema | The token's user lacks access in Unity Catalog | Ask your Databricks workspace administrator to grant access to the catalog or schema |
Related
- Connect a database or app: the shared connector workspace steps and the full SQL view.
- Manage saved connections: edit the connection when a token expires.
- Allow Mammoth through your firewall: the IP address to allow.
- Refresh a dataset: change when the dataset refreshes.
- Connector reference: every source Mammoth connects to.
Something wrong? support@mammoth.io