Skip to content
  • There are no suggestions because the search field is empty.

Use Unity Catalog (Project)

Applies to
Platform: Databricks

Use Unity Catalog (UseUnityCatalog, formerly Unity Catalog) decides whether Databricks objects are created in Unity Catalog or in the Hive metastore. It changes the object names, the deployment headers and the constraints.

Databricks dbt does not offer the property.

Values and default

Set the value in the Implementation group of the Additional Settings in Project Settings:

  • true (default): objects are named catalog.schema.object.
  • false: objects are named database.object in the Hive metastore.

Effect on generated output

  • Layer header: CREATE SCHEMA IF NOT EXISTS with true, CREATE DATABASE IF NOT EXISTS with false.
  • Primary keys and unique constraints: declared only with true.
  • Foreign keys: declared NOT ENFORCED only with true.
  • Placeholder database_name: datalakehouse with true, the layer name with false.
  • Placeholder schema_name: the layer name with true, empty with false.

The layer header creates the schema only when the Deployment Options contain Generate Create Schema If Not Exists Statements; the database statement with false does not depend on them. With false, the replacement configuration also has a database_directory placeholder for the location of each database. replace_placeholders.ps1 removes the empty schema together with its dot from the object names. Apply Sensitivity Level Tags has an effect only with true.

Example

The Raw Vault header of a Data Vault project with true (line breaks added):

spark.sql('CREATE SCHEMA IF NOT EXISTS
    `{<project>#rawvault#database_name}`.
    `{<project>#rawvault#schema_name}`')

With false:

spark.sql("CREATE DATABASE IF NOT EXISTS
    `{<project>#rawvault#database_name}`
    LOCATION '{<project>#rawvault#database_directory}'")

Release differences

Up to Generator 1.10 the default was False; since Generator 2.0 it is True.

Related articles