Skip to content
Learn › Get data in › Connectors: open the docs menu

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

  1. In Databricks, go to SQL Warehouses.
  2. Select the warehouse you want to use.
  3. 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

  1. Go to the Data Library, click New dataset, and choose Connectors.
  2. Search for Databricks and click its tile. The connection form opens.
  3. Fill in the fields below. A callout below the fields reminds you to whitelist Mammoth's IP address.
  4. Click Connect. If the check fails, the error appears at the bottom of the form.
  5. Once Mammoth has connected, the connector workspace opens on your tables. See Connect a database or app for the shared steps.
FieldWhat to enterExample
Host URLYour Databricks workspace hostnamedbc-a1b2c3d4-e5f6.cloud.databricks.com
PortConnection port443 (default)
HTTP PathThe SQL warehouse's connection endpoint/sql/1.0/warehouses/a1b2c3d4e5f6g7h8
Personal Access TokenYour Databricks PAT
Catalog NameThe Unity Catalog to connect to, fixed for this connectionmain
Display NameOptional label for this connection in MammothDatabricks 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

  1. In Tables, click a table. Mammoth opens its rows with the query that read them, in Databricks' backtick style: SELECT * FROM `schema`.`table` .
  2. 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

  1. Click Save as dataset.
  2. Enter a Name and pick a folder.
  3. Under Keep it up to date, choose Daily at 06:00 or Only when I ask.
  4. Next to the sentence that says what each refresh does, click Change and pick an option under On each refresh (see the table below).
  5. Click Save as dataset.
On each refreshWhat it does
Replace all rowsMatches the source after every refresh
Add only new rowsKeeps what you have and adds rows above the last value of a Key column
Add every row againShown instead when the result has no numeric or date column, so each refresh adds a full copy
Keep only the newest rowsEmpties 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:

  1. In Databricks, go to User Settings → Developer → Access tokens.
  2. Generate a new token, or check the expiry date on your existing one.
  3. In Mammoth, go to Data → Connections, open the connection, click Edit connection, and update the Personal Access Token.

Other Databricks problems

SymptomLikely causeFix
Connection fails with a valid tokenThe HTTP Path is wrongCopy it from a running SQL warehouse's Connection details, not a cluster or job
Connection fails with a valid tokenMammoth's IP address isn't allowedWhitelist it in your Databricks network configuration
No tables appear in a schemaThe token's user lacks access in Unity CatalogAsk your Databricks workspace administrator to grant access to the catalog or schema
Was this page helpful?

Something wrong? support@mammoth.io