cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Governance
Join discussions on data governance practices, compliance, and security within the Databricks Community. Exchange strategies and insights to ensure data integrity and regulatory compliance.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Create a catalog with external location from different Metastore

erigaud
Honored Contributor

Hello community !

Here's my problem : I had a workspace with Unity Catalog enabled, and a catalog stored on an external location (Azure storage account). All my schemas and tables were storage on this storage.

erigaud_0-1713797409085.png

 

However we recently deleted the metastore, and created a new one. 

I am wondering if it is possible to re-create a catalog by specifying the same external location, to access all my schemas and tables again ? 

I tried doing so but I no longer see my schemas and tables on Databricks, so I am wondering if now that the metastore changed, I will not be able to see my tables ? 

Thank you for the help !

 

3 REPLIES 3

ScottSmithDB
Databricks Employee
Databricks Employee

If both the Catalog and the Schema and tables are stored externally, and you have deleted the original catalog, you should be able to recreate the schema in a new catalog by pointing it to the previous data files and running the SYNC command. Here are the steps .
1. Define an External Location in the new catalog that points to the same location where your previous data files are stored. Sounds like you did this.
2. Use the SYNC command to create a new Unity Catalog table based on your legacy table location. This will only create metadata and not change the underlying data. The syntax is as follows:

SYNC hive_metastore.schema.table uc_catalog.schema.table This command will create a new table in your new catalog that points to the same data files as your old table.  It sounds like you may not have done this.

Note that the SYNC command assumes that the data files are still in the same location and have not been moved or deleted. If the data files have been moved, you will need to adjust the External Location accordingly.

Hope this is helpful.

erigaud
Honored Contributor

I have an issue when trying to create a new catalog based on the previous catalog location : 

erigaud_0-1714038636622.png

Any idea ? Thanks Scott ! 

dkushari
Databricks Employee
Databricks Employee

Hi,

Looks like you are creating the catalog at the container level. Are there any other UC objects created pointing to that? Is the external location created at the container level? Can you please have a look at this and see if there is overlapping? Thanks!

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