Skip to main content
(Applies to dbt v2.0 and later)

Connect Databricks to Fusion Preview

You can configure the Databricks adapter by running dbt init in your CLI or manually providing the profiles.yml file with the fields configured for your authentication type.

The Databricks adapter for Fusion supports the following authentication methods:

  • Personal access token (for individual users)
  • Service Principal token (for service users)
  • OAuth

Warehouse permissions for Fusion

The Databricks user or service principal that dbt Fusion engine uses must have privileges on the catalog and schemas where models run, plus access required for metadata queries. Requirements depend on whether you use Unity Catalog or the legacy Hive Metastore.

Required Databricks objects

Before connecting, these objects must exist or be accessible:

ObjectPurpose
WorkspaceYour Databricks workspace URL (host)
SQL warehouse or clusterCompute resource (using http_path)
CatalogUnity Catalog or Hive Metastore catalog
SchemaTarget schema within the catalog
User or service principalIdentity for authentication

Unity Catalog

Required access for the Unity Catalog:

PermissionObjectPurpose
USE CATALOGCatalogAccess the catalog
USE SCHEMASchemaAccess schemas
SELECTTables or viewsRead existing data and sources
CREATE TABLESchemaCreate models materialized as tables
CREATE VIEWSchemaCreate models materialized as views
MODIFYTablesInsert, update, and delete data
CREATE SCHEMACatalogAuto-create schemas (if needed)

Hive Metastore

Required access for the legacy Hive Metastore:

PermissionObjectPurpose
USAGEDatabaseAccess the database
SELECTTablesRead data
CREATEDatabaseCreate tables and views
MODIFYTablesModify data

Metadata operations

The following are required for fundamental dbt features:

Query typeSQL usedRequired permission
Get table schemaDESCRIBE TABLE or DESCRIBE TABLE EXTENDEDSELECT on table
Get table schema (DBR 16.2+)DESCRIBE TABLE EXTENDED ... AS JSONSELECT on table
List relationsQuery INFORMATION_SCHEMA.TABLESUSE CATALOG and USE SCHEMA
Source freshnessQuery INFORMATION_SCHEMA.TABLES for last_alteredUSE CATALOG
Get view definitionQuery SYSTEM.INFORMATION_SCHEMA.VIEWSAccess to system catalog
Create schemasCREATE SCHEMA IF NOT EXISTSCREATE SCHEMA on catalog

Python models

Optional permissions for environments using Python models

PermissionObjectPurpose
Workspace API access/api/2.0/workspace/*Create notebook directories
Notebook importWorkspaceImport Python notebooks
Job executionCluster or warehouseRun Python models

Databricks configuration details

The dbt Fusion engine dbt-databricks adapter is the only supported connection method for Databricks.

dbt-databricks can connect to Databricks SQL Warehouses. These warehouses are the recommended way to get started with Databricks.

Refer to the Databricks docs for more info on how to obtain the credentials for configuring your profile.

Configure Fusion

Executing dbt init in your CLI will prompt for the following fields:

  • Host: Databricks instance hostname (excluding the http or https prefix)
  • HTTP Path: Path to your SQL server or cluster
  • Schema: The development/staging/deployment schema for the project
  • Catalog (Optional): The Databricks catalog containing your schemas and tables

Alternatively, you can manually create the profiles.yml file and configure the fields. See examples in authentication section for formatting. If there is an existing profiles.yml file, you are given the option to retain the existing fields or overwrite them.

Next, select your authentication method. Follow the on-screen prompts to provide the required information.

Supported authentication types

Enter your personal access token (PAT) for the Databricks environment. For more information about obtaining a PAT, refer to the Databricks documentation. This is considered a legacy feature by Databricks and OAuth is recommended over PATs.

Example personal access token configuration

profiles.yml
default:
target: dev
outputs:
dev:
type: databricks
database: TRANSFORMING
schema: JANE_SMITH
host: YOUR.HOST.COM
http_path: YOUR/PATH/HERE
token: ABC123
auth_type: databricks_cli
threads: 16

More information

Find Databricks-specific configuration information in the Databricks adapter reference guide.

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0
Loading