Databricks Certified Data Engineer & Generative AI Engineer — Lakehouse, Delta Lake, DLT & Unity Catalog

Advanced Databricks Lakehouse flashcards covering Delta Lake internals (_delta_log, ACID, Time Travel, VACUUM, OPTIMIZE, ZORDER, Liquid Clustering), Medallion Architecture, Auto Loader, Delta Live Tables (DLT expectations & CDC), Unity Catalog governance, and Mosaic AI Vector Search.

Category
Project Management, Agile & AI/Data Certifications — PMI PMP, PRINCE2 7th Ed., Scrum (PSM/CSPO) & ITIL 4 + AWS AI/ML, Databricks & Snowflake
Level
advanced
Languages
en → en
Cards
32
Markdown
Databricks Certified Data Engineer & Generative AI Engineer — Lakehouse, Delta Lake, DLT & Unity Catalog (.md)

Flashcards (32)

#Front (Term / Question)Back (Definition / Answer)ExampleMultiple-Choice Options
1What is Delta Sharing in Databricks, and how does it enable cross-platform data sharing without data replication?Delta Sharing is an open protocol for sharing live Delta tables, views, volumes, and models across clouds and platforms using pre-signed URLs without copying data.A retail supplier shares a live `gold_inventory` table from Unity Catalog to an external partner's Pandas/Power BI environment via an open Delta Sharing token without duplicating S3 storage.
  • Open protocol integrated with Unity Catalog that shares live Delta tables, views, volumes, and AI models across clouds and platforms without copying data.
  • Supports Databricks-to-Databricks (D2D) sharing via metastore IDs and Open Sharing via bearer tokens / OIDC federation.
  • Delta Sharing is an open protocol for sharing live Delta tables, views, volumes, and models across clouds and platforms using pre-signed URLs without copying data.
2In Delta Live Tables (DLT), what is the architectural difference between a Streaming Table, a Materialized View, and a Temporary View?A Streaming Table processes append-only streams incrementally once; a Materialized View (`LIVE TABLE`) maintains recomputed physical query results; a Temporary View (`LIVE VIEW`) is unpersisted.In DLT SQL, `CREATE OR REFRESH STREAMING TABLE bronze_iot AS SELECT * FROM cloud_files(...)` ingests new files once, while `CREATE OR REFRESH LIVE TABLE gold_summary` maintains a materialized aggregation.
  • A Streaming Table processes append-only streams incrementally once; a Materialized View (`LIVE TABLE`) maintains recomputed physical query results; a Temporary View (`LIVE VIEW`) is unpersisted.
  • Streaming Table = stateful incremental ingestion (`STREAM()`); Materialized View (`LIVE TABLE`) = incrementally/fully refreshed physical table; View = logical only.
  • Use Streaming Tables for Bronze/Silver append streams and Materialized Views for Gold aggregations or complex joins.
3In Databricks Workflows (Lakeflow Jobs), how do Task Values (`dbutils.jobs.taskValues`), Repair Run, and Cluster types (Job Compute vs. All-Purpose Compute) work?`taskValues` passes parameters across tasks; 'Repair Run' reruns only failed tasks; ephemeral Job Compute bills at a lower DBU rate than All-Purpose Compute.If Task 4 of a 6-task nightly pipeline fails due to an API timeout, clicking 'Repair Run' in Databricks Workflows skips Tasks 1–3 and runs only Tasks 4–6 on automated Job Compute.
  • Always schedule production Databricks Workflows on automated Job Compute (or Serverless) rather than All-Purpose Compute to reduce DBU costs, and use Repair Run to rerun only failed tasks.
  • `taskValues` passes parameters across tasks; 'Repair Run' reruns only failed tasks; ephemeral Job Compute bills at a lower DBU rate than All-Purpose Compute.
  • `dbutils.jobs.taskValues` passes dynamic state across tasks in a multi-task DAG, including `If/Else` condition and `For Each` loop tasks.
4What are the four `cloudFiles.schemaEvolutionMode` options in Databricks Auto Loader, and what is the `_rescued_data` column?`addNewColumns` (evolves schema on restart), `rescue` (routes unexpected fields into `_rescued_data`), `failOnNewColumns` (halts without evolving), and `none` (ignores new columns).When an upstream microservice adds an unexpected `loyalty_tier` JSON field, Auto Loader in `addNewColumns` mode updates the schema in `schemaLocation` and restarts cleanly via Databricks Workflow retries.
  • `addNewColumns` (default), `rescue` (captures drift in `_rescued_data` JSON column), `failOnNewColumns`, and `none`.
  • The `_rescued_data` column captures unmapped fields and data-type mismatches as JSON so zero raw data is lost during ingestion.
  • `addNewColumns` (evolves schema on restart), `rescue` (routes unexpected fields into `_rescued_data`), `failOnNewColumns` (halts without evolving), and `none` (ignores new columns).
5What is Databricks Lakehouse Monitoring, and what three profile types can it compute on a Delta table or Model Serving Inference Table?Time Series profile (windowed metrics by timestamp), Snapshot profile (full-table metrics), and Inference Log profile (model drift, prediction shift, and accuracy).Attaching a Lakehouse Monitor with an `InferenceLog` profile to a Model Serving Inference Table automatically creates two metric Delta tables (`_profile_metrics` and `_drift_metrics`) and a Lakeview dashboard.
  • Time Series profile (windowed metrics by timestamp), Snapshot profile (full-table metrics), and Inference Log profile (model drift, prediction shift, and accuracy).
  • Time Series, Snapshot, and Inference Log profiles, outputting `_profile_metrics` and `_drift_metrics` Delta tables plus an automated dashboard.
  • Lakehouse Monitoring tracks null rates, schema changes, statistical distribution drift (Wasserstein/KS/PSI), and model performance directly in Unity Catalog.
6How do `OPTIMIZE`, `ZORDER BY`, and Liquid Clustering (`CLUSTER BY`) improve query performance in Delta Lake?`OPTIMIZE` compacts small Parquet files; `ZORDER BY` co-locates multidimensional values for data skipping; Liquid Clustering (`CLUSTER BY`) incrementally clusters data without full rewrites.Creating a table with `CREATE TABLE events CLUSTER BY (customer_id, event_date)` replaces static Hive partitioning and `ZORDER BY` with incremental, skew-resistant Liquid Clustering.
  • `OPTIMIZE` compacts small Parquet files; `ZORDER BY` co-locates multidimensional values for data skipping; Liquid Clustering (`CLUSTER BY`) incrementally clusters data without full rewrites.
  • `OPTIMIZE` fixes the small-file problem; `ZORDER BY` enables multi-column data skipping; `CLUSTER BY` (Liquid Clustering) provides flexible incremental clustering.
  • Databricks recommends Liquid Clustering (`CLUSTER BY`) over traditional `PARTITIONED BY` + `ZORDER BY` for new Delta tables.
7How does Delta Lake Change Data Feed (CDF) work when `delta.enableChangeDataFeed = true` is set on a table?CDF records row-level `insert`, `update_preimage`, `update_postimage`, and `delete` events with commit versions, queryable via `table_changes('table', v1, v2)`.Downstream Silver-to-Gold pipelines read `spark.readStream.format('delta').option('readChangeFeed', 'true').table('silver_users')` to propagate only modified user rows instead of scanning the entire table.
  • Captures `_change_type` (`insert`, `update_preimage`, `update_postimage`, `delete`), `_commit_version`, and `_commit_timestamp` for downstream incremental consumers.
  • CDF records row-level `insert`, `update_preimage`, `update_postimage`, and `delete` events with commit versions, queryable via `table_changes('table', v1, v2)`.
  • Query CDF in SQL via `SELECT * FROM table_changes('my_table', 5, 10)` or in PySpark with `.option('readChangeFeed', 'true')`.
8How are fine-grained Row Filters and Column Masks implemented in Databricks Unity Catalog (versus legacy Dynamic Views)?Define SQL UDFs using `IS_ACCOUNT_GROUP_MEMBER()` and attach them directly to tables via `SET ROW FILTER` and `ALTER COLUMN ... SET MASK`.Running `ALTER TABLE hr.employees ALTER COLUMN ssn SET MASK hr.mask_ssn` redacts SSN values for non-HR analysts directly on the base table without maintaining separate dynamic views.
  • Attach SQL UDFs using `IS_ACCOUNT_GROUP_MEMBER()` directly to tables via `SET ROW FILTER` and `ALTER COLUMN ... SET MASK`.
  • Define SQL UDFs using `IS_ACCOUNT_GROUP_MEMBER()` and attach them directly to tables via `SET ROW FILTER` and `ALTER COLUMN ... SET MASK`.
  • Unity Catalog supports native table-level `ROW FILTER` and column-level `MASK` UDFs as well as Dynamic Views using `is_account_group_member()`.
9What are the three Data Quality Expectation violation behaviors in Delta Live Tables (DLT)?`EXPECT` retains invalid rows and logs metrics; `ON VIOLATION DROP ROW` (`expect_or_drop`) drops invalid rows; `ON VIOLATION FAIL UPDATE` (`expect_or_fail`) halts the pipeline.In a Silver orders table, `CONSTRAINT valid_id EXPECT (order_id IS NOT NULL) ON VIOLATION DROP ROW` filters out corrupt records while recording the drop count in the DLT Event Log.
  • `EXPECT` retains invalid rows and logs metrics; `ON VIOLATION DROP ROW` (`expect_or_drop`) drops invalid rows; `ON VIOLATION FAIL UPDATE` (`expect_or_fail`) halts the pipeline.
  • Retain & log (`expect`), Drop row (`expect_or_drop` / `ON VIOLATION DROP ROW`), and Fail pipeline (`expect_or_fail` / `ON VIOLATION FAIL UPDATE`).
  • DLT expectations enforce declarative data quality rules and log pass/fail metrics directly into the pipeline event log.
10What is the three-level namespace hierarchy in Databricks Unity Catalog, and how does the Metastore relate to workspaces?Unity Catalog uses `catalog.schema.table` (plus volumes, views, functions, and models) governed by a regional Metastore shared across multiple workspaces.Querying `SELECT * FROM prod_catalog.finance_schema.gl_entries` accesses a centrally governed table whose ACLs, audit logs, and column lineage apply consistently across all attached Databricks workspaces.
  • Unity Catalog uses `catalog.schema.table` (plus volumes, views, functions, and models) governed by a regional Metastore shared across multiple workspaces.
  • `catalog.schema.table` (or volume/model/function) governed by a single regional Unity Catalog Metastore shared across workspaces.
  • Legacy Hive metastore was workspace-scoped (`hive_metastore.schema.table`), whereas Unity Catalog is account-level across workspaces.
11What are Databricks System Tables (`system.*`), and how do `system.billing.usage`, `system.access.audit`, and `system.access.table_lineage` support enterprise governance?System Tables in the `system` catalog expose SQL-queryable account logs for DBU billing (`billing.usage`), security audits (`access.audit`), and lineage (`access.table_lineage`).A FinOps engineer joins `system.billing.usage` with `system.billing.list_prices` to calculate daily dollar spend per custom job tag across all workspaces.
  • System Tables in the `system` catalog expose SQL-queryable account logs for DBU billing (`billing.usage`), security audits (`access.audit`), and lineage (`access.table_lineage`).
  • `system.billing.usage` tracks DBU spend, `system.access.audit` records security events, `system.access.table_lineage` tracks upstream/downstream dependencies, and `system.query.history` logs SQL warehouse queries.
  • Enabled via Unity Catalog, `system.*` tables let administrators monitor cost, lineage, and audit trails using standard SQL.
12What is Lakehouse Federation in Databricks Unity Catalog?Lakehouse Federation uses Foreign Connections and Foreign Catalogs in Unity Catalog to query external databases (Snowflake, Postgres, MySQL, BigQuery) in place with pushdown.After creating a `CONNECTION` to an operational PostgreSQL RDS instance and mounting a `FOREIGN CATALOG`, analysts join live Postgres `orders` with Delta Lake `clickstreams` in a single SQL query under Unity Catalog permissions.
  • Queries external relational databases and data warehouses in place through Unity Catalog `CONNECTION` and `FOREIGN CATALOG` objects without ETL ingestion.
  • Applies Unity Catalog access controls, lineage, and query pushdown across external engines like PostgreSQL, MySQL, Snowflake, and BigQuery.
  • Lakehouse Federation uses Foreign Connections and Foreign Catalogs in Unity Catalog to query external databases (Snowflake, Postgres, MySQL, BigQuery) in place with pushdown.
13How does Adaptive Query Execution (AQE) in Spark 3+ on Databricks optimize joins, partitions, and data skew at runtime?AQE uses runtime shuffle statistics to coalesce small partitions, convert Sort-Merge Joins into Broadcast Hash Joins, and split skewed partitions.When a 500 GB table is filtered down to 8 MB at runtime before joining a 2 TB fact table, AQE dynamically converts the Sort-Merge Join into a fast Broadcast Hash Join.
  • AQE uses runtime shuffle statistics to coalesce small partitions, convert Sort-Merge Joins into Broadcast Hash Joins, and split skewed partitions.
  • Dynamically coalesces shuffle partitions, converts Sort-Merge Joins to Broadcast Joins, and splits skewed join partitions using runtime statistics.
  • AQE (`spark.sql.adaptive.enabled = true`) eliminates manual `repartition()` tuning and mitigates `OutOfMemory` straggler tasks from data skew.
14How do Databricks Asset Bundles (DABs — `databricks.yml`) standardize CI/CD for Lakehouse jobs, DLT pipelines, and ML models?Databricks Asset Bundles define jobs, DLT pipelines, and models as code in `databricks.yml`, deployed across environments via `databricks bundle validate/deploy/run`.During a GitHub Actions release, running `databricks bundle deploy -t prod` deploys the parameterized DLT pipeline and Multi-Task Workflow using a production Service Principal identity.
  • Declarative YAML project format (`databricks.yml`) managed via `databricks bundle validate / deploy / run` for multi-environment CI/CD.
  • Databricks Asset Bundles define jobs, DLT pipelines, and models as code in `databricks.yml`, deployed across environments via `databricks bundle validate/deploy/run`.
  • Replaces legacy `dbx` by managing Workflows, DLT pipelines, Model Serving endpoints, and Unity Catalog grants as versioned code across `dev`/`prod` targets.
15How does Databricks Auto Loader (`cloudFiles`) ingest files from cloud storage more efficiently than standard `spark.readStream` file sources?Auto Loader uses `.format('cloudFiles')` to discover new files incrementally via cloud notifications or optimized directory listing, tracking state in RocksDB checkpoints.When ingesting millions of hourly JSON files from S3, Auto Loader avoids expensive full S3 `LIST` scans and automatically persists inferred schemas to `cloudFiles.schemaLocation`.
  • Uses `.format('cloudFiles')` with RocksDB state tracking, incremental directory listing or file notifications, and automatic schema inference/evolution.
  • Auto Loader uses `.format('cloudFiles')` to discover new files incrementally via cloud notifications or optimized directory listing, tracking state in RocksDB checkpoints.
  • Auto Loader scales to billions of files in cloud storage and handles schema drift via the `_rescued_data` column.
16What SQL syntax queries historical snapshots or restores a table in Delta Lake Time Travel?Query historical states using `VERSION AS OF n` or `TIMESTAMP AS OF 'ts'`, and roll back via `RESTORE TABLE table TO VERSION AS OF n`.After an accidental `DELETE` at commit version 42, an engineer runs `RESTORE TABLE main.sales.orders TO VERSION AS OF 41` to atomically revert the table state.
  • `VERSION AS OF <num>`, `TIMESTAMP AS OF <ts>`, and `RESTORE TABLE <name> TO VERSION AS OF <num>`.
  • Query historical states using `VERSION AS OF n` or `TIMESTAMP AS OF 'ts'`, and roll back via `RESTORE TABLE table TO VERSION AS OF n`.
  • Use `SELECT * FROM tbl VERSION AS OF 12` to read a historical snapshot and `RESTORE TABLE` to roll back in place.
17How does `APPLY CHANGES INTO` in Delta Live Tables (DLT) handle out-of-order Change Data Capture (CDC) events for SCD Type 1 and SCD Type 2?`APPLY CHANGES INTO` orders CDC events by `SEQUENCE BY` and updates target tables in place (`SCD TYPE 1`) or tracks history (`SCD TYPE 2`).When a customer address update with `updated_at = 10:05` arrives before an older update from `10:01`, `SEQUENCE BY updated_at STORED AS SCD TYPE 2` orders both revisions accurately without manual `MERGE` logic.
  • Uses `KEYS`, `SEQUENCE BY`, `APPLY AS DELETE WHEN`, and `STORED AS SCD TYPE 1` (overwrite in place) or `SCD TYPE 2` (`__START_AT` / `__END_AT` history columns).
  • `APPLY CHANGES INTO` orders CDC events by `SEQUENCE BY` and updates target tables in place (`SCD TYPE 1`) or tracks history (`SCD TYPE 2`).
  • Eliminates complex procedural `MERGE INTO` code by declaratively sequencing out-of-order CDC streams into SCD Type 1 or Type 2 tables.
18What are the four deployment patterns in Databricks Mosaic AI Model Serving?Foundation Model APIs (open LLMs), External Models (governed proxy to OpenAI/Anthropic/Bedrock), Custom Models (MLflow/PyFunc), and Mosaic AI Agent Framework endpoints.An enterprise routes all OpenAI GPT-4o and Anthropic Claude calls through a Mosaic AI External Model endpoint so API keys stay hidden in Unity Catalog and prompts are logged to Inference Tables.
  • Foundation Model APIs, External Models (OpenAI/Anthropic/Bedrock proxy), Custom MLflow/PyFunc Models, and Mosaic AI Agent Framework endpoints.
  • Enabling AI Gateway and Inference Tables on Model Serving endpoints automatically logs request/response payloads to a Unity Catalog Delta table for monitoring.
  • Foundation Model APIs (open LLMs), External Models (governed proxy to OpenAI/Anthropic/Bedrock), Custom Models (MLflow/PyFunc), and Mosaic AI Agent Framework endpoints.
19In Databricks Mosaic AI Vector Search (tested on the Generative AI Engineer exam), how do Delta Sync Indexes (Managed vs. Self-Managed Embeddings) and Direct Vector Access Indexes differ?Delta Sync Indexes automatically sync from a Delta table via Change Data Feed (managed or self-managed embeddings); Direct Vector Access uses REST/SDK upserts.When a new chunk is appended to `main.rag.doc_chunks` (with `delta.enableChangeDataFeed = true`), a Delta Sync Index with Managed Embeddings automatically embeds the text using `databricks-gte-large-en` and updates the vector index.
  • Delta Sync Indexes automatically stay in sync with a source Delta table via Change Data Feed (CDF); Direct Vector Access Indexes are updated via REST API/SDK calls without a Delta sync pipeline.
  • Delta Sync Indexes automatically sync from a Delta table via Change Data Feed (managed or self-managed embeddings); Direct Vector Access uses REST/SDK upserts.
  • Enable `delta.enableChangeDataFeed = true` on the source Delta table to use Mosaic AI Vector Search Delta Sync Indexes.
20What are Unity Catalog Volumes (`catalog.schema.volume`), and when should you use them instead of DBFS (`dbfs:/`)?Volumes govern unstructured or semi-structured files (PDFs, CSVs, images, ML artifacts) at `/Volumes/<catalog>/<schema>/<volume>/`, replacing legacy DBFS root mounts.In a GenAI RAG pipeline, raw PDF manuals are uploaded to `/Volumes/main/rag/raw_pdfs/` with `READ VOLUME` permissions granted to the ingestion service principal.
  • Governed file storage in Unity Catalog accessed via `/Volumes/catalog/schema/volume/`, replacing insecure legacy DBFS root mounts.
  • Volumes come in Managed and External variants to apply Unity Catalog RBAC and lineage to arbitrary files.
  • Volumes govern unstructured or semi-structured files (PDFs, CSVs, images, ML artifacts) at `/Volumes/<catalog>/<schema>/<volume>/`, replacing legacy DBFS root mounts.
21What is Delta UniForm (Universal Format) in Databricks?Delta UniForm automatically generates Apache Iceberg and Hudi metadata alongside `_delta_log` over one shared copy of Parquet files for cross-engine reads.Enabling `'delta.universalFormat.enabledFormats' = 'iceberg'` on a Unity Catalog Managed Delta table lets external Trino or BigQuery Iceberg readers query the exact same Parquet files in place.
  • Writes Delta Lake, Apache Iceberg, and Apache Hudi metadata over a single copy of Parquet files for zero-copy cross-engine interoperability.
  • Delta UniForm automatically generates Apache Iceberg and Hudi metadata alongside `_delta_log` over one shared copy of Parquet files for cross-engine reads.
  • Eliminates format lock-in by translating `_delta_log` commits into Iceberg and Hudi metadata manifests automatically.
22In Spark Structured Streaming on Databricks, how do `Trigger(availableNow=True)` and Watermarking (`withWatermark`) work?`availableNow=True` processes all backlog data across micro-batches then stops; `withWatermark` bounds state memory by dropping late records older than the threshold.Combining `.withWatermark('event_time', '2 hours').dropDuplicates(['event_id', 'event_time'])` with `.trigger(availableNow=True)` runs an incremental hourly deduplication job that shuts down its cluster when finished.
  • `availableNow=True` processes all backlog data in micro-batches then stops; `withWatermark` expires old state keys to prevent OOM errors.
  • `availableNow=True` processes all backlog data across micro-batches then stops; `withWatermark` bounds state memory by dropping late records older than the threshold.
  • Use `availableNow=True` over legacy `once=True` for scalable incremental batch processing in Structured Streaming.
23How do Shallow Clones and Deep Clones (`CREATE TABLE ... CLONE`) differ in Delta Lake?`SHALLOW CLONE` copies only `_delta_log` metadata referencing source Parquet files; `DEEP CLONE` copies both metadata and physical Parquet files to an independent path.Before testing a complex `MERGE INTO` script, a data engineer runs `CREATE TABLE dev.sales.orders SHALLOW CLONE prod.sales.orders` in 2 seconds without duplicating 10 TB of Parquet files.
  • `SHALLOW CLONE` copies only `_delta_log` metadata referencing source Parquet files; `DEEP CLONE` copies both metadata and physical Parquet files to an independent path.
  • Shallow Clone copies only transaction log metadata (references source files); Deep Clone copies both metadata and physical Parquet data files.
  • If the source table runs `VACUUM` and deletes underlying files, a `SHALLOW CLONE` referencing those files can break, whereas a `DEEP CLONE` is fully independent.
24How does Delta Lake achieve ACID transactions, schema enforcement, and optimistic concurrency control on cloud object storage?Delta Lake combines immutable Parquet data files with an ordered, atomic `_delta_log` directory of JSON commits and checkpoints as the single source of truth.When two Spark jobs write to a Delta table simultaneously, the `_delta_log` uses optimistic concurrency control to serialize commits or throw a `ConcurrentAppendException` if conflicting files were modified.
  • Combines versioned Parquet data files with the `_delta_log` transaction log directory of atomic JSON commits and checkpoint files.
  • The `_delta_log` tracks every added/removed Parquet file, schema change, and file statistic to guarantee ACID isolation on S3/ADLS/GCS.
  • Delta Lake combines immutable Parquet data files with an ordered, atomic `_delta_log` directory of JSON commits and checkpoints as the single source of truth.
25How does Delta Lake Data Skipping work under the hood when evaluating a `WHERE` filter?Delta Lake stores per-file column statistics (min, max, null counts) for the first 32 columns in `_delta_log` to skip irrelevant Parquet files.When a query filters `WHERE order_date = '2026-11-11'`, the Photon engine inspects `_delta_log` file statistics and skips 98% of Parquet files without opening them.
  • Delta Lake stores per-file column statistics (min, max, null counts) for the first 32 columns in `_delta_log` to skip irrelevant Parquet files.
  • Stores file-level min/max/null statistics in `_delta_log` (default first 32 columns) to prune irrelevant Parquet files at query time.
  • Combine Data Skipping statistics with `OPTIMIZE ZORDER BY` or `CLUSTER BY` so file min/max ranges are tightly bounded.
26In the Databricks Mosaic AI Agent Framework and Agent Evaluation, how are Tool-Calling Agents built and evaluated?Register tools as Unity Catalog Functions (`CREATE FUNCTION`), trace calls with MLflow Tracing, and evaluate RAG/agent outputs using LLM-as-a-Judge metrics (`mlflow.evaluate`).By registering `main.crm.lookup_customer_tier(id STRING)` as a Unity Catalog SQL function, any authorized Mosaic AI agent can discover and invoke it as a governed tool with automatic lineage tracking.
  • Register tools as Unity Catalog Functions (`CREATE FUNCTION`), trace calls with MLflow Tracing, and evaluate RAG/agent outputs using LLM-as-a-Judge metrics (`mlflow.evaluate`).
  • Govern agent tools as Unity Catalog SQL/Python Functions (`CREATE FUNCTION`), trace execution with MLflow Tracing, and score RAG quality via Mosaic AI Agent Evaluation judges.
  • Mosaic AI Agent Evaluation measures Retrieval Quality (context precision/recall) and Generation Quality (groundedness/faithfulness, answer relevance, correctness, safety).
27In Unity Catalog, how do Storage Credentials, External Locations, Managed Tables, and External Tables interact?External Locations bind cloud URIs to Storage Credentials; dropping a Managed Table deletes metadata and data files, whereas dropping an External Table keeps files.When an analyst runs `DROP TABLE prod.sales.managed_orders`, Unity Catalog removes the table from the schema and cleans up underlying cloud files; dropping an External Table leaves S3 Parquet files untouched.
  • External Locations bind cloud URIs to Storage Credentials; dropping a Managed Table deletes metadata and data files, whereas dropping an External Table keeps files.
  • Managed Tables let Unity Catalog manage both lifecycle and storage files; External Tables register files in an External Location and retain files on `DROP TABLE`.
  • Storage Credential (cloud IAM auth) + cloud URI = External Location, which secures External Tables and Unmanaged Volumes.
28What does the Delta Lake `VACUUM` command do, what is its default retention threshold, and what happens to Time Travel after running it?`VACUUM` deletes unreferenced Parquet files older than the retention threshold (default 7 days / 168 hours), disabling Time Travel past that window.Running `VACUUM events RETAIN 0 HOURS` requires disabling `spark.databricks.delta.retentionDurationCheck.enabled` and can corrupt active concurrent readers or writers.
  • Removes obsolete Parquet files no longer referenced by `_delta_log` older than 7 days (168 hours) by default.
  • `VACUUM` deletes unreferenced Parquet files older than the retention threshold (default 7 days / 168 hours), disabling Time Travel past that window.
  • Default retention is 7 days (168 hours); running `VACUUM` removes physical files required to Time Travel past the retention period.
29What are the responsibilities of the Bronze, Silver, and Gold layers in the Databricks Medallion Lakehouse Architecture?Bronze stores raw append-only source payloads; Silver cleanses, deduplicates, and conforms entities; Gold provides aggregated star-schema or KPI tables for BI and ML.Raw Kafka JSON clickstreams land in `bronze_clicks` via Auto Loader, are deduplicated and joined with users in `silver_sessions`, and roll up into `gold_daily_revenue`.
  • Bronze = raw append-only ingestion; Silver = filtered, deduplicated, validated enterprise data; Gold = business-level aggregates and analytics marts.
  • Bronze stores raw append-only source payloads; Silver cleanses, deduplicates, and conforms entities; Gold provides aggregated star-schema or KPI tables for BI and ML.
  • Bronze preserves raw source fidelity for replayability, Silver provides a single source of truth, and Gold powers BI dashboards.
30How do you register, govern, and deploy a GenAI / ML model using MLflow 3 and Unity Catalog (`mlflow.set_registry_uri('databricks-uc')`)?Set registry URI to `'databricks-uc'`, log the model with a `ModelSignature`, register as `catalog.schema.model`, and manage deployments using Aliases like `@champion`.In Unity Catalog Model Registry, legacy stages (`Staging`/`Production`) are replaced by flexible Model Aliases like `@champion`, allowing zero-downtime endpoint updates when `@champion` is reassigned to version 4.
  • Use `mlflow.set_registry_uri('databricks-uc')`, register as `catalog.schema.model_name` with a `ModelSignature`, and manage lifecycle via `@champion` / `@challenger` Aliases.
  • Set registry URI to `'databricks-uc'`, log the model with a `ModelSignature`, register as `catalog.schema.model`, and manage deployments using Aliases like `@champion`.
  • Unity Catalog Model Registry requires a `ModelSignature` and uses Aliases (`@champion`) rather than deprecated workspace-registry stages.
31What is the Databricks Photon Engine, and what workloads benefit most from enabling it?Photon is a native C++ vectorized query engine accelerating SQL and DataFrame scans, joins, aggregations, and Delta writes (excluding custom Python UDFs).Replacing a Python `@udf` with built-in Spark SQL functions on a Photon-enabled SQL Warehouse or Job Cluster yields a 4× speedup because Photon executes natively in C++ without JVM-to-Python serialization.
  • C++ vectorized execution engine built for Delta Lake and Apache Spark SQL/DataFrames; does not accelerate non-vectorized Python UDFs.
  • Photon is a native C++ vectorized query engine accelerating SQL and DataFrame scans, joins, aggregations, and Delta writes (excluding custom Python UDFs).
  • Photon accelerates large joins, aggregations, `MERGE INTO`, and Delta writes on SQL Warehouses and Photon-enabled clusters.
32What are Deletion Vectors (`delta.enableDeletionVectors = true`) in Delta Lake, and how do they accelerate `DELETE`, `UPDATE`, and `MERGE` operations?Deletion Vectors record soft-deleted row indices in compact roaring bitmaps (Merge-on-Read) instead of rewriting entire Parquet files during `DELETE`, `UPDATE`, or `MERGE`.When a GDPR job deletes 50 customer rows scattered across 50 different 1 GB Parquet files, Deletion Vectors complete in seconds by writing tiny bitmap files rather than rewriting 50 GB of Parquet.
  • Deletion Vectors record soft-deleted row indices in compact roaring bitmaps (Merge-on-Read) instead of rewriting entire Parquet files during `DELETE`, `UPDATE`, or `MERGE`.
  • Uses Merge-on-Read bitmap markers to flag deleted/modified rows without rewriting entire Parquet files during `DELETE`/`UPDATE`/`MERGE`.
  • Deletion Vectors drastically speed up DML writes and are physically compacted out when `OPTIMIZE` or `REORG TABLE ... APPLY (PURGE)` runs.