cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community 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?

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!