cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

Change default catalog

gilo12
New Contributor III

It seems that when I am connecting to Databricks Warehouse, it is using the default catalog which is hive_metastore. Is there a way to define unity catalog to be the default?

I know I can run the query

USE CATALOG MAIN

And then the current session will use unity-catalog. But I am looking for a way that it will always be the default. So, if the first query after login we will be

CREATE SCHEMA IF NOT EXISTS MY_SCHEMA

The schema will be created inside the main catalog.

2 REPLIES 2

Brian2
New Contributor III

You can set this per notebook or workspace or even at the compute level.

spark.databricks.sql.initial.catalog.name mycatalog

If you add this to your cluster's spark config, all tools that run using that cluster will default to that catalog.

Jon-ton
New Contributor II

Thanks Brian2. Is there an equivalent config parameter for a SQL Warehouse?

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group