What you will be able to do
- Place the metastore, catalogs, schemas, tables, views and volumes correctly in the Unity Catalog hierarchy
- Write fully qualified catalog.schema.table names and predict how one- and two-part names resolve
- Use USE CATALOG and USE SCHEMA to set the session context, and check it with current_catalog() and current_schema()
- Tell when a volume is addressed by its three-part name and when by its /Volumes/ path
Key concept
Three-level namespace — In Unity Catalog, every table, view or volume is named by three parts: the catalog that contains it, the schema inside that catalog, and the object itself. The metastore sits above all three as the container for them and is not part of the name.
1.The metastore and the three levels beneath it
Every table you query in a Unity Catalog workspace has an address made of three names: catalog.schema.table. That address does two jobs. It tells the SQL engine which object you mean, and it gives the access-control model a hierarchy to work through. A query that names the wrong level, or leaves a level out, either fails or reads a different table from the one you wanted.
The metastore is the container above the namespace, but it is not one of the three levels. A metastore covers one cloud region. Your organization has one metastore per region, and that one metastore can be attached to several workspaces in the same region. So a workspace is not a namespace level either. Several workspaces can share the same catalogs because they share the metastore. Some objects live directly under the metastore rather than inside a catalog: storage credentials, external locations, connections and shares.
From the top down, the three levels are:
- Catalog: the first level, which sits directly under the metastore.
- Schema: the middle level, a child of a catalog.
- Object: a table, view, volume, function or model, which lives inside a schema.
Catalogs and schemas are container objects because they hold children. Tables, views, volumes and functions don't. That difference matters for permissions, because privileges granted on a container reach the objects inside it. The rules for granting are covered in Unity Catalog privileges and inheritance.
| Level | Position | Contains |
|---|---|---|
| Metastore | Top-level container, one per cloud region; not part of the name | Catalogs, plus storage credentials, external locations, connections, shares |
| Catalog | First part of catalog.schema.table | Schemas |
| Schema | Second part of catalog.schema.table | Tables, views, volumes, models, functions |
| Table / view / volume | Third part of the name | Rows and columns (table), a saved query (view), or files (volume) |
Checkpoint 1 of 8· Match them up
Match each Unity Catalog level to where it sits and what it holds
Tap a term, then the definition that fits it.
The metastore sits above the namespace, so it is not one of its three levels. A name is made of catalog, then schema, then the object itself, which can be a table, view or volume.
“data and metadata live in a top-level container called a metastore. Within this metastore, data is represented as objects in a three-level namespace: catalog.schema.table”Source: docs.databricks.com
Checkpoint 2 of 8· Exam question
In Unity Catalog, what are the three levels of the namespace used to fully qualify a table, listed from the top (broadest) level down to the object itself?
Correct answer: A — Catalog, schema, table
- A. This is the correct order: a catalog is the top-level container, a schema (database) sits inside a catalog, and the table, view, volume, or function is the object inside the schema, giving the fully qualified
catalog.schema.tableform. - B. This is incorrect because the metastore sits above the catalog level and is not part of the three-level object reference; queries never include the metastore name in the qualified path.
- C. This is incorrect because 'workspace' is not a level in the object namespace at all — a single Unity Catalog metastore, and its catalogs, can be attached to multiple workspaces.
- D. This is incorrect because 'account' is an organizational boundary above the metastore, not a namespace level used when qualifying a table reference.
2.Catalogs isolate, schemas organise
A catalog is the unit of isolation. It is the highest level you design yourself, so each catalog should stand for a logical unit of data isolation and a logical category of data access. That is why catalogs usually follow organizational units or software development lifecycle scopes. Typical examples are a prod catalog and a dev catalog, or one catalog for non-customer data and another for sensitive customer data. Grants flow down from a catalog to everything inside it, so a well-chosen catalog boundary is also an access boundary. Isolation is physical too. A catalog usually has its own managed storage location for managed tables and volumes, and because there is one metastore per region, catalogs are also isolated by region.
A schema divides a catalog into finer groups. A schema typically represents one use case, project or team sandbox. Two schemas in different catalogs can have the same name, and the same is true of tables. prod.sales.orders and dev.sales.orders are separate objects that can hold different data. A schema can also have its own managed storage location. If it doesn't, its managed data goes to the catalog's location, and if the catalog has none either, to the metastore's location.
Databricks has a few naming habits that trip up people coming from other databases. In Databricks a schema is sometimes called a database, and CREATE DATABASE is an alias for CREATE SCHEMA. In some relational systems a database is a collection of schemas, but here the two words name the same level. Every catalog also automatically contains an INFORMATION_SCHEMA, a reserved schema of read-only metadata views that describe the catalog's objects.
Some catalogs exist before anyone creates one:
- Workspace catalog: created by default in new workspaces and usually named after the workspace. All users of that workspace, and only that workspace, can use it by default.
- hive_metastore: holds objects from the legacy Hive metastore, which is deprecated.
- __databricks_internal: a reserved catalog where Databricks stores internal state for features such as Lakeflow pipelines and AI/BI dashboards. Don't query, modify or delete its objects.
There is also the foreign catalog, a catalog type you create rather than one provisioned for you. A foreign catalog mirrors a database in an external system for read-only queries through Lakehouse Federation.
Checkpoint 3 of 8· Check yourself
A company must keep production and development data apart, with separate access and separate managed storage for each. Within each environment, it wants to group tables by project. Which Unity Catalog layout fits this?
The catalog is the unit of isolation. Grants and managed storage are usually set at the catalog, so environments like prod and dev map to catalogs, and schemas split each catalog by project. A region has only one metastore, and workspaces attached to it share the same catalogs, so neither can separate the environments.
“You might choose, for example, to have a catalog for production data and a catalog for development data”Source: docs.databricks.com
3.Fully qualified names
A three-part name points to exactly one object. catalog.schema.table is unique in the metastore, so it means the same thing in every session and every tool. Querying by table name works in all Databricks execution contexts and supported languages.
SELECT * FROM catalog_name.schema_name.table_nameYou can leave out leading parts of the name, and Databricks fills them in from the session. A two-part name gets the current catalog. A one-part name gets both the current catalog and the current schema. Databricks never searches other catalogs for a matching name. Suppose prod and dev both contain sales.orders. Writing sales.orders reads whichever catalog the session is currently in. The only way to be sure you read the prod copy is prod.sales.orders.
| Identifier pattern | Refers to |
|---|---|
| catalog_name.schema_name.object_name | Exactly the object named |
| schema_name.object_name | That schema and object in the current catalog |
| object_name | That object in the current catalog and current schema |
Use fully qualified identifiers whenever a query or workload reads objects from more than one schema or catalog. A fully qualified reference also doesn't change the session's current catalog or schema. You can therefore mix a three-part reference into a script that relies on short names without breaking the names that come after it.
Checkpoint 4 of 8· Check yourself
A session's current catalog is dev, and the prod and dev catalogs both contain sales.orders. A script first runs SELECT * FROM prod.sales.orders, then runs SELECT * FROM sales.orders. Which table does the second query read?
When the catalog part is left out, Databricks fills in the session's current catalog and does not search other catalogs. A fully qualified reference does not change the current catalog, so the session is still in dev and the second query reads dev.sales.orders.
“If you omit the top-level catalog name when you perform data operations, the default catalog is assumed.”Source: docs.databricks.com
Checkpoint 5 of 8· Exam question
A workspace has two catalogs, prod and dev, and both contain a schema named sales with a table named orders that have different row counts. An analyst needs to query only the orders table in the prod catalog. Which approach correctly and unambiguously targets that table?
Correct answer: A — Run SELECT * FROM prod.sales.orders;, since fully qualifying the query with the catalog, schema, and table name removes any ambiguity about which orders table is targeted.
- A. Supplying all three levels of the namespace removes any guesswork: Unity Catalog looks up
ordersinsidesalesinsideproddirectly, so it cannot resolve to the table indevby mistake. - B. This is incorrect because Unity Catalog has no rule that favors one catalog over another when a schema name collides; without a current catalog set, an unqualified two-part reference is ambiguous or resolves against whatever default is in effect, not necessarily
prod. - C. This is incorrect because setting the session catalog to
devmakessales.ordersresolve insidedev, notprod, which is the opposite of what the analyst needs. - D. This is incorrect because Unity Catalog does not track or use 'most recently created' as a resolution rule; a bare table name still requires a current catalog and schema to be set, and provides no guarantee of hitting
prod.
Sources6
4.How USE CATALOG and USE SCHEMA resolve short names
Short names are completed from two settings in the session: the current catalog and the current schema. In a new session, the current catalog is the workspace's default catalog. When a workspace was enabled for Unity Catalog automatically, that default is the pre-provisioned workspace catalog, and a workspace admin can change it. The default schema name is default. So a bare SELECT * FROM sales_orders really means <workspace default catalog>.default.sales_orders.
Resolving an unqualified table name takes three steps:
- If the name is inside a
WITHclause, Databricks first looks for a common table expression with that name. - Next it looks for a temporary view or temporary table in the session.
- Last, it adds the current catalog and current schema to the front of the name and looks for a persisted table.
If nothing matches, the query fails with TABLE_OR_VIEW_NOT_FOUND. That error means no object exists at the name the query was resolved to, and it often happens even though the table exists somewhere else. The fix is to point the session at the right place with USE CATALOG and USE SCHEMA, or to write the full three-part name.
The example below first sets the current catalog and schema, then reaches one table three ways. Here spark_catalog is simply the catalog the example makes current with USE CATALOG. In your own session it would be the workspace default catalog or whichever catalog you set, and the resolution rule is identical.
-- Setting up a scenario
> USE CATALOG spark_catalog;
> USE SCHEMA default;
> CREATE TABLE rel(c1 int);
> INSERT INTO rel VALUES(1);
-- An fully qualified reference to rel:
> SELECT c1 FROM spark_catalog.default.rel;
1
-- A partially qualified reference to rel:
> SELECT c1 FROM default.rel;
1
-- An unqualified reference to rel:
> SELECT c1 FROM rel;
1The order of the two statements matters. USE CATALOG changes the current catalog and also resets the current schema to default. USE SCHEMA changes only the schema, and the schema must exist in the current catalog. If you want to set both in one statement, USE SCHEMA catalog_name.schema_name does that. When you're unsure where a short name will resolve, SELECT current_catalog(), current_schema() shows you.
-- Setting the catalog resets the schema to `default`
> USE CATALOG some_cat;
> SELECT current_catalog(), current_schema();
some_cat default
-- Setting the schema within the current catalog
> USE SCHEMA some_schem;
> SELECT current_catalog(), current_schema();
some_cat some_schemaCheckpoint 6 of 8· Check yourself
In a workspace that was enabled for Unity Catalog automatically, a workspace admin has changed the default catalog to prod. An analyst opens a brand-new SQL session, runs no USE statements, and queries SELECT * FROM sales.orders. Which catalog does Databricks look in for sales.orders?
A new session's current catalog is the workspace's default catalog, and an admin can change that default. With the catalog part left out, Databricks fills in prod, so the query reads prod.sales.orders.
“If you omit the top-level catalog name when you perform data operations, the default catalog is assumed.”Source: docs.databricks.com
Checkpoint 7 of 8· Exam question
A data analyst in the Databricks SQL editor runs SELECT * FROM sales_orders; and gets an error that the table cannot be found, even though the table exists and the analyst has been granted SELECT on it. No catalog or schema has been set for the session. What is the most likely cause, and how should the analyst fix it?
Correct answer: A — The query gives only a table name with no catalog or schema in context, so Unity Catalog cannot resolve it; the analyst should run USE CATALOG and USE SCHEMA, or reference catalog.schema.sales_orders directly.
- A. Unity Catalog's three-level namespace means an unqualified table name has no way to determine which catalog and schema to search unless a current catalog and schema are already set for the session. Running
USE CATALOGandUSE SCHEMA, or fully qualifying the reference, gives Unity Catalog the context it needs to locate the table. - B. This is incorrect because Unity Catalog privilege grants take effect immediately and are not subject to a multi-minute propagation delay; the described symptom does not match how grants are applied.
- C. This is incorrect because Volumes are for unstructured files, not the described object; a genuine table that shows up in Catalog Explorer as a table is queryable with SQL SELECT, so this explanation does not fit the scenario.
- D. This is incorrect because Databricks SQL warehouses fully support the three-level
catalog.schema.tablenamespace; removing the catalog prefix would not fix an unqualified-name resolution problem and is not required by the platform.
5.Volumes: governed files at the third level
Volumes sit at the same level as tables, but they hold files instead of rows. A volume is a Unity Catalog object for non-tabular data in any format, whether structured, semi-structured or unstructured. Typical contents are raw landing files, staging areas for ingestion, images and PDFs, and library files. A volume lives in a schema just as a table does, so it is named catalog.schema.volume. Like tables, volumes come in managed and external types. A managed volume lives in Unity Catalog storage. An external volume adds governance to an existing cloud storage path.
A volume has two kinds of address, and each one has its own job. You use the three-part identifier for management commands such as CREATE VOLUME and DROP VOLUME. To read or write files, you use a path:
/Volumes/<catalog>/<schema>/<volume>/<path>/<file-name>
The /<catalog>/<schema>/<volume> part of the path is just the three object names. Those directories are read-only and managed by Unity Catalog, so you can't create or delete them with filesystem commands. You also can't list objects with a partial path such as /Volumes/<catalog-name>/<schema-name>. The path must include a volume name.
SELECT * FROM json.`/Volumes/catalog_name/schema_name/volume_name/path/to/data`Tables and volumes cannot stand in for each other. The files in a volume can't be registered as a table, because volumes are for path-based access only, and a managed table can't be read by path, so you always use its name. To query tabular files with SELECT ... FROM name, load their contents into a new table instead: read the /Volumes/ path and write the result out with CTAS (CREATE TABLE AS), COPY INTO or Auto Loader. That is what a volume used as an ingestion staging location is for. How managed and external tables are created is covered in creating managed and external tables.
| Object | Object identifier | File path | Cloud URI |
|---|---|---|---|
| Managed table | yes | no | no |
| External table | yes | no | yes |
| Managed volume | no | yes | no |
| External volume | no | yes | yes |
Checkpoint 8 of 8· Match them up
Which addresses can reach the data of each Unity Catalog object type? Pair each object with its allowed access methods.
Tap a term, then the definition that fits it.
Tables are read by name and volumes by /Volumes path. Only the external types can also be reached through a cloud URI. A volume's three-part name is used only for management commands, so you can't run SELECT FROM catalog.schema.volume.
“Always interact with Unity Catalog managed tables using table names and Unity Catalog managed volumes using volume paths.”Source: docs.databricks.com
Practise it for real
Watch the session context change and see how it affects the way short names resolve
1.In the SQL editor, run SELECT current_catalog(), current_schema();
Why: This shows where unqualified names resolve before you have set anything.
You should see: The workspace's default catalog and the schema default.
2.Run USE CATALOG followed by a catalog you can access, then run SELECT current_catalog(), current_schema(); again.
Why: This shows that switching catalog also resets the schema.
You should see: The new catalog name, with the schema shown as default.
3.Run USE SCHEMA with a schema in that catalog, then check current_schema() again.
Why: USE SCHEMA changes only the schema within the current catalog.
You should see: The same catalog, now with your chosen schema.
4.Query one table twice: once by its bare table name and once as catalog.schema.table.
Why: Both return the same rows only because the session context matches the full name.
You should see: Identical results. Switch to a different catalog, and the bare name fails with TABLE_OR_VIEW_NOT_FOUND while the three-part name still works.
Stuck? Get a nudge
USE SCHEMA catalog_name.schema_name sets both values in one statement.
Sources
(11)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“your data assets live in a three-level namespace that defines its catalog, schema, and type of asset, such as table (catalog.schema.table)”
↩︎ The metastore and the three levels beneath it“A single metastore can be attached to multiple workspaces in the same region.”
↩︎ The metastore and the three levels beneath it“your data assets live in a three-level namespace that defines its catalog, schema, and type of asset, such as table (catalog.schema.table)”
↩︎ Exam trap 1 - 2.
“Other objects, such as storage credentials, external locations, connections, and shares, sit directly under the metastore.”
↩︎ The metastore and the three levels beneath it - 3.https://docs.databricks.com/aws/en/data-governance/unity-catalog/access-control/permissions-conceptsOfficial docs
“Schemas: The middle level of the three-level namespace. Schemas contain tables, views, volumes, and functions as direct children.”
↩︎ The metastore and the three levels beneath it“Within this metastore, data is represented as objects in a three-level namespace: catalog.schema.table.”
↩︎ Key concept“data and metadata live in a top-level container called a metastore. Within this metastore, data is represented as objects in a three-level namespace: catalog.schema.table”
↩︎ Checkpoint - 4.https://docs.databricks.com/aws/en/catalogsOfficial docs
“each catalog should represent a logical unit of data isolation and a logical category of data access”
↩︎ Catalogs isolate, schemas organise“Catalogs therefore often mirror organizational units or software development lifecycle scopes.”
↩︎ Catalogs isolate, schemas organise“Do not query, modify, or delete objects in the __databricks_internal catalog.”
↩︎ Catalogs isolate, schemas organise“If you omit the top-level catalog name when you perform data operations, the default catalog is assumed.”
↩︎ How USE CATALOG and USE SCHEMA resolve short names“You might choose, for example, to have a catalog for production data and a catalog for development data”
↩︎ Checkpoint“If you omit the top-level catalog name when you perform data operations, the default catalog is assumed.”
↩︎ Checkpoint - 5.https://docs.databricks.com/aws/en/schemasOfficial docs
“In Databricks, schemas are sometimes called databases. For example, CREATE DATABASE is an alias for CREATE SCHEMA.”
↩︎ Catalogs isolate, schemas organise“Every Unity Catalog catalog automatically includes an INFORMATION_SCHEMA, a system-provided schema of read-only metadata views that describe the catalog's objects.”
↩︎ Catalogs isolate, schemas organise - 6.https://docs.databricks.com/aws/en/queryOfficial docs
“Databricks recommends using fully-qualified identifiers when queries or workloads interact with database objects stored across multiple schemas or catalogs.”
↩︎ Fully qualified names“Querying by table name is supported in all Databricks execution contexts and supported languages.”
↩︎ Fully qualified names“do not change the current catalog or schema and always refer to the object specified.”
↩︎ Fully qualified names“Set the current catalog using the provided catalog_name and the current schema using the provided schema_name.”
↩︎ How USE CATALOG and USE SCHEMA resolve short names - 7.
“The default schema name is default.”
↩︎ How USE CATALOG and USE SCHEMA resolve short names - 8.
“If the relation cannot be resolved to any table, view, or CTE, Databricks raises a TABLE_OR_VIEW_NOT_FOUND error.”
↩︎ How USE CATALOG and USE SCHEMA resolve short names“If the identifier consists of two parts: schema.relation, it is further qualified with the result of SELECT current_catalog() to make it unique.”
↩︎ Exam trap 2 - 9.
“For the USE CATALOG Unity Catalog privilege, which users need to interact with objects in a catalog, see USE CATALOG.”
↩︎ How USE CATALOG and USE SCHEMA resolve short names“Setting the catalog also resets the current schema to default.”
↩︎ Exam trap 3“Setting the catalog also resets the current schema to default.”
↩︎ Prediction - 10.https://docs.databricks.com/aws/en/volumesOfficial docs
“While tables govern tabular data, volumes govern non-tabular data of any format, including structured, semi-structured, or unstructured.”
↩︎ Volumes: governed files at the third level“The /<catalog>/<schema>/<volume> portion of the path maps to the three Unity Catalog object names for the file.”
↩︎ Volumes: governed files at the third level“You can't register files in volumes as tables in Unity Catalog. Volumes are intended for path-based data access only.”
↩︎ Volumes: governed files at the third level“Register staging locations for ingestion. For example, using Auto Loader, COPY INTO, or CTAS (CREATE TABLE AS) statements.”
↩︎ Volumes: governed files at the third level - 11.https://docs.databricks.com/aws/en/volumes/pathsOfficial docs
“Unity Catalog volumes use three-tier object identifiers with the following pattern for management commands (such as CREATE VOLUME and DROP VOLUME):”
↩︎ Volumes: governed files at the third level“Path-based access to Unity Catalog managed tables is not supported.”
↩︎ Volumes: governed files at the third level“To actually work with files in volumes, you must use path-based access.”
↩︎ Exam trap 4“Always interact with Unity Catalog managed tables using table names and Unity Catalog managed volumes using volume paths.”
↩︎ Checkpoint