Skip to main content

Connect to Databricks

Securely connect your Hex workspace to your Databricks database.

info
  • Users need the Admin workspace role to create a shared workspace data connection.
  • Users need Can Edit or higher project permissions to create project data connections.
  • Hex currently only supports the legacy JDBC driver where the JDBC URL starts with jdbc:spark.

Databricks is a data analytics platform built on top of Apache Spark.

Databricks allows you to combine the robustness of a data warehouse with the flexibility of a data lake via their lakehouse architecture. It provides a unified platform that offers a wide variety of services, allowing you to store and process large amounts of data quickly and efficiently, including real-time analytics.

Databricks can be especially useful for machine learning/artificial intelligence, data engineering, and data science applications.

How to get set up

  1. Set up a Databricks account and create a workspace if you don't already have one.
  2. Create and configure a Databricks warehouse.
  3. Locate your JDBC URL.
  4. Generate an access token in Databricks for a user with access to the data you want to query.
  5. In Hex, go to SettingsData sources.
  6. Select + Connection, select Databricks, and fill out the fields below.

You can authenticate with an access token (steps above) or with OAuth for per-user warehouse credentials.

Basic settings

  1. Name and Description - Set a display name and optional description to help identify your data connection.
Databricks data connection name and description
  1. JDBC URL (instructions to locate)
  2. Access token (instructions to generate)
Databricks data connection database and authentication credentials

Additional settings

The data connection form includes several optional sections:

tip

If you use a firewall to restrict database access, you'll need to add Hex's IP addresses to your allowlist.

OAuth setup

info
  • Available on the Enterprise plan.
  • Users need the Admin workspace role to configure OAuth data connections.

OAuth requires each Hex user to authenticate to Databricks with their own credentials. Create a custom OAuth application in Databricks, add the client credentials in Hex to create a workspace OAuth token, then set a data connection's authentication type to OAuth Token.

Connections with OAuth enabled can affect product behavior — learn more.

Step 1: Create a custom OAuth application in Databricks

A Databricks Admin enables a custom OAuth application and creates a CLIENT_ID and CLIENT_SECRET. Follow the Databricks OAuth documentation.

Set the allowed redirect URL to:

  • Multi-tenant: https://app.hex.tech/databricks-oauth-success
  • Single-tenant, EU, or HIPAA: https://<YOUR-HEX-DOMAIN-NAME>/databricks-oauth-success

Step 2: Create the OAuth connection in Hex

  1. Go to Workspace Settings → Data sources.
  2. Find Databricks OAuth Connections and select + Connection.
  3. Provide a connection name and host (https://<your-databricks-instance>.cloud.databricks.com), enter the Client ID and Client Secret, then select Add connection. You are redirected to the Databricks login screen. After you authenticate, setup is complete.

Step 3: Update your data connection

Edit your Databricks data connection and set Authentication type to OAuth Token. Configure OAuth permissions on the connection as needed.

Set Authentication type to OAuth Token on a data connection