Skip to main content

Connect Databricks Fusion compatible

The dbt-databricks adapter is maintained by the Databricks team. The Databricks team is committed to supporting and improving the adapter over time, so you can be sure the integrated experience will provide the best of dbt and the best of Databricks. Connecting to Databricks via dbt-spark has been deprecated.

About the dbt-databricks adapter

dbt-databricks is compatible with the following versions of dbt Core in dbt with varying degrees of functionality.

Featuredbt Versions
dbt-databricksAvailable starting with dbt 1.0 in dbt
Unity CatalogAvailable starting with dbt 1.1
Python modelsAvailable starting with dbt 1.3
Loading table...

The dbt-databricks adapter offers:

  • Easier set up
  • Better defaults: The dbt-databricks adapter is more opinionated, guiding users to an improved experience with less effort. Design choices of this adapter include defaulting to Delta format, using merge for incremental models, and running expensive queries with Photon.
  • Support for Unity Catalog: Unity Catalog allows Databricks users to centrally manage all data assets, simplifying access management and improving search and query performance. Databricks users can now get three-part data hierarchies – catalog, schema, model name – which solves a longstanding friction point in data organization and governance.

To learn how to optimize performance with data platform-specific configurations in dbt, refer to Databricks-specific configuration.

To grant users or roles database permissions (access rights and privileges), refer to the example permissions page.

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
Loading table...

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)
Loading table...

Hive Metastore

Required access for the legacy Hive Metastore:

PermissionObjectPurpose
USAGEDatabaseAccess the database
SELECTTablesRead data
CREATEDatabaseCreate tables and views
MODIFYTablesModify data
Loading table...

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
Loading table...

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
Loading table...

Connection fields

To set up the Databricks connection, supply the following fields:

FieldDescriptionExamples
Server HostnameThe hostname of the Databricks account to connect todbc-a2c61234-1234.cloud.databricks.com
HTTP PathThe HTTP path of the Databricks cluster or SQL warehouse/sql/1.0/warehouses/1a23b4596cd7e8fg
CatalogName of Databricks Catalog (optional)Production
Loading table...
Configuring a Databricks connection using the dbt-databricks adapterConfiguring a Databricks connection using the dbt-databricks adapter

Was this page helpful?

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

0
Loading