Databricks DE · Topic 8.1
One governance layer over all data & AI: a metastore→catalog→schema→object hierarchy, the 3-level name catalog.schema.object, Volumes for files, plus built-in discovery, lineage, and audit. This deep dive walks each with the code.
catalog.schema.object. Volumes govern files; lineage & audit are automatic (queryable as system tables).▸ metastore → catalog → schema → object
Create the hierarchy, then address objects fully-qualified or set a default catalog+schema for short names. Common pattern: catalog per environment/domain.
CREATE CATALOG IF NOT EXISTS prod; CREATE SCHEMA IF NOT EXISTS prod.sales; SELECT * FROM prod.sales.orders; -- fully qualified USE CATALOG prod; USE SCHEMA sales; -- then short names resolve SELECT * FROM orders; -- → prod.sales.orders
Inspect metadata via information_schema
SELECT table_name, table_type FROM prod.information_schema.tables WHERE table_schema = 'sales'; SELECT column_name, data_type FROM prod.information_schema.columns WHERE table_schema = 'sales' AND table_name = 'orders';
The UC-governed place for files; access at /Volumes/<catalog>/<schema>/<volume>/…. Managed = UC owns storage; external = your path under a UC external location. Replaces DBFS mounts.
CREATE VOLUME prod.sales.landing; -- managed CREATE EXTERNAL VOLUME prod.sales.archive LOCATION 's3://acme-lake/sales/archive/'; -- external
# Read/write files through the /Volumes path — governed like any UC object dbutils.fs.ls("/Volumes/prod/sales/landing/") df = spark.read.json("/Volumes/prod/sales/landing/clickstream.json") df.write.format("delta").saveAsTable("prod.sales.bronze_clicks")
information_schema & COMMENT/TAGS make them searchable.system.access.column_lineage.system.access.audit system table records all data access & system activity for compliance/security.-- Document + tag for search/governance COMMENT ON TABLE prod.sales.orders IS 'Curated order facts (gold).'; ALTER TABLE prod.sales.orders SET TAGS ('domain'='sales', 'pii'='false'); ALTER TABLE prod.sales.orders ALTER COLUMN email SET TAGS ('pii'='true');
-- Who accessed what (audit) + column lineage — via system tables SELECT event_time, user_identity.email, action_name FROM system.access.audit WHERE action_name = 'getTable' AND event_date >= current_date() - 7; SELECT * FROM system.access.column_lineage WHERE target_table_name = 'orders';
prod.finance.invoices is governed once — analysts discover it in Catalog Explorer, lineage shows it feeds the revenue dashboard, and audit logs record every access for compliance.hive_metastore (2-level) with UC (3-level) confuses references; lineage captures UC-tracked operations only; information_schema is per-catalog while system.information_schema spans the metastore.schema.table habits — UC is three-level.