Exams / DBX-DEA / D1 Data Governance & Quality
Data Governance & Quality (part 1)
- Exam domain: Data Governance & Quality
Unity Catalog privileges
Privileges are checked down the hierarchy catalog → schema → table. To reach an object you need USE CATALOG on the parent catalog and USE SCHEMA on the parent schema; DATABASE is interchangeable with SCHEMA in SQL.
| Goal | Privileges |
|---|---|
| Browse/read a table | USE CATALOG + USE SCHEMA + SELECT |
| Create tables in a schema | USE CATALOG + USE SCHEMA + CREATE TABLE |
| Read a view | SELECT on the view (+ USE CATALOG/USE SCHEMA); the view owner's rights cover the base tables on shared compute |
| Everything on an object | ALL PRIVILEGES (does not include MANAGE, READ METADATA, EXTERNAL USE SCHEMA) |
Syntax: GRANT <privilege> ON <object type> <name> TO <group>;. There is no USE TABLE privilege and VIEW is not a privilege.
Every securable object has an owner; the table page in Catalog Explorer (formerly Data Explorer) shows the Owner field. Ownership transfer is done by the owner, a MANAGE holder or a metastore admin.
DESCRIBE DATABASE name (or DESCRIBE SCHEMA) returns the name, comment and location.
Managed vs external tables
| Managed | External | |
|---|---|---|
| Storage lifecycle | Unity Catalog | You |
DROP TABLE |
Metadata and data files deleted | Only metadata removed, files remain |
Managed tables are the default and recommended type.
Expectations (Delta Live Tables / Lakeflow Spark Declarative Pipelines)
| Clause | Effect |
|---|---|
EXPECT (...) |
Rows kept, violations logged in metrics |
ON VIOLATION DROP ROW |
Invalid rows dropped, metrics tracked |
ON VIOLATION FAIL UPDATE |
The update fails; no metrics recorded |
Metrics come from the pipeline event log (flow_progress events). Quarantining invalid rows needs custom logic.
Lineage, sharing and the lakehouse
- Unity Catalog lineage shows upstream/downstream tables, jobs, notebooks and dashboards.
- Delta Sharing: a share is read-only for recipients. Open sharing works for recipients without Databricks; Databricks-to-Databricks also shares notebooks, volumes and models.
- A lakehouse gives one source of truth; Delta Lake adds ACID transactions and schema enforcement.
PySpark access to tables
spark.table("sales") loads a registered table as a DataFrame; spark.sql("SELECT ...") runs a query and returns a DataFrame. spark.delta.table is not an API.
Exam traps
ON VIOLATION FAILandON DROP ROWare not valid; the clauses areFAIL UPDATEandDROP ROW.- Dropped rows are not quarantined automatically.
- Dropping an external table never deletes data files.
USE TABLEdoes not exist; creating tables needsUSE CATALOG+USE SCHEMA+CREATE TABLE.- Shares are read-only; write access for internal users comes from Unity Catalog grants.
Docs
- https://docs.databricks.com/aws/en/ldp/expectations
- https://docs.databricks.com/aws/en/data-governance/unity-catalog/manage-privileges/privileges
- https://docs.databricks.com/aws/en/data-governance/unity-catalog/manage-privileges/ownership
- https://docs.databricks.com/aws/en/tables/types
- https://docs.databricks.com/aws/en/data-governance/unity-catalog/data-lineage
- https://docs.databricks.com/aws/en/delta-sharing/
- https://docs.databricks.com/aws/en/views/
- https://docs.databricks.com/aws/en/lakehouse/