I am migrating tables from hive_metastore to Unity Catalog for my Databricks workspaces.
I have three databricks workspaces:
- Dev
- Test
- Prod
Each workspace has its own ADLSv2 storage account. (Dev, test, prod)
Currently when developing I read in a table using
df = spark.table('bronze.my_table') # schema.table
This uses the default hive_metastore which points to the corresponding container (Workspace Dev -> Storage account Dev).
However, with Unity Catalog. It seems I would now have to specify the catalog too based on which workspace I work in. Unless, there is a default unity catalog for a workspace.
df = spark.table('dev.bronze.my_table') # catalog.schema.table
When deploying code from Dev -> Test -> Prod workspace. I would like to avoid having to dynamically set the catalog name for all notebooks using spark.table based on workspace (dev, test, prod). Basically 'bronze.my_table' when working in Dev points to delta table data stored in the dev catalog. While in Prod it points to delta table data stored in the prod catalog. Is this possible? I assume I can use the previous hive_metastore (one for each workspace) and build Unity Catalog on top of it (they reference each other and are in sync). However, isn't the idea that the Unity Catalog replaces the hive_metastore?