cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
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?