CertifyDeck
All cheat sheets
DP-750 · CHEAT SHEET

Microsoft Certified: Azure Databricks Data Engineer Associate

Key concepts grouped by official exam weight.

Download as PDF (free, no sign-up)

1. Set up and configure an Azure Databricks environment

15–20%

Select and configure compute in a workspace

  • Serverless compute is recommended for most notebooks, jobs and pipelines; classic jobs compute is for settings serverless lacks (and Spark Submit tasks). Standard access mode (formerly shared) lets several users share compute with isolation; R, RDD APIs or the ML runtime need dedicated access mode. For SQL, serverless warehouses are recommended and pro warehouses suit custom networking.
  • Autoscaling adds and removes workers between a minimum and a maximum and must not be combined with Spark Dynamic Allocation. Automatic termination stops compute after a period with no commands. Instance pools shorten start-up: the compute maximum cannot exceed the pool capacity, and the driver should be on-demand even when workers use spot. Single node compute runs Spark locally and cannot become multi-node.
  • Photon is the Azure Databricks vectorized engine: it speeds up SQL, DataFrame work and Delta writes but does not support UDFs or RDD APIs, which fall back to Spark. It is on by default in the UI; with the Clusters or Jobs API you set runtime_engine to PHOTON. Use the most current runtime for all-purpose compute and an LTS version for operational jobs. The Machine learning checkbox selects Databricks Runtime ML and sets dedicated access mode.
  • Compute-scoped libraries serve every notebook and job on the compute; %pip creates notebook-scoped libraries that do not affect others and do not persist across sessions. Databricks recommends storing wheels, JARs and requirements.txt files in volumes or workspace files, not DBFS; in standard access mode, Maven coordinates and JARs must be on the allowlist. Policies can enforce libraries, and serverless uses the Environment side pane.
  • Compute permissions are NO PERMISSIONS, CAN VIEW, CAN ATTACH TO (attach notebooks), CAN RESTART (also start, restart and terminate) and CAN MANAGE (edit, resize, attach libraries and change permissions). Driver logs are visible only with CAN MANAGE unless spark.databricks.acl.needAdminPermissionToViewLogs is changed. Compute policies restrict the settings of users without unrestricted cluster creation but cannot define permissions.

Create and organize objects in Unity Catalog

  • Unity Catalog stores names in lowercase, allows up to 255 characters and forbids periods, spaces and slashes; other special characters need backticks. Recommended practice is lowercase with underscores, bronze, silver and gold schemas, and per-environment or {domain}_{environment} catalogs to isolate dev, test and prod. For external sharing, use clear names that hide internal structure, such as table aliases in a share.
  • Creating a catalog requires CREATE CATALOG on the metastore and, with MANAGED LOCATION, CREATE MANAGED STORAGE on the external location; without metastore-level storage the location is mandatory. The default and information_schema schemas are created automatically. Catalogs are the main isolation unit, often one per environment, and workspace-catalog binding, optionally read-only, denies access from unassigned workspaces.
  • A schema is the second level of catalog.schema.object and usually represents one use case, project or team. Creating one requires USE CATALOG and CREATE SCHEMA on the catalog; in Unity Catalog the storage path is set with MANAGED LOCATION (not LOCATION) and needs CREATE MANAGED STORAGE. Without its own location, its managed tables and volumes use the catalog's location or, failing that, the metastore's. INFORMATION_SCHEMA is reserved.
  • Volumes govern non-tabular data as catalog.schema.volume and are accessed with /Volumes/<catalog>/<schema>/<volume> paths. Managed volumes are the default: dropping one marks its files for deletion. External volumes register a path in an external location, need CREATE EXTERNAL VOLUME, and keep their files when dropped. READ VOLUME and WRITE VOLUME apply to the whole volume, with no folder-level permissions.
  • A Unity Catalog view only registers its query text and is evaluated when queried; creating one requires USE CATALOG, USE SCHEMA and CREATE TABLE on the schema plus read access to the referenced tables. A materialized view stores precomputed results, runs on a serverless pipeline, refreshes with TRIGGER ON UPDATE, SCHEDULE or REFRESH (optionally ASYNC) and does not support time travel.

2. Secure and govern Unity Catalog objects

15–20%

Secure Unity Catalog objects

  • GRANT and REVOKE assign privileges to users, service principals or groups; privileges granted on a catalog or schema are inherited by current and future objects. Reading a table requires SELECT, USE SCHEMA and USE CATALOG. Grants can be made by the object owner, the owner of its container, a MANAGE holder or a metastore admin. ALL PRIVILEGES excludes MANAGE, and BROWSE only exposes metadata.
  • Column- and row-level control uses views that omit columns or dynamic views that call is_account_group_member() in CASE or WHERE to filter rows or mask values; grant SELECT on the view, not on the base tables. Dynamic views suit curated or joined data; table-level row filters and column masks suit single-table logic, and ABAC policies suit tag-based rules across many tables.
  • An Azure Key Vault-backed secret scope is a read-only interface to the vault, which must use the Vault access policy model; secrets are created in Azure and access is granted per scope with put-acl. Notebooks read them with dbutils.secrets.get(), which redacts the value as [REDACTED], and Spark configuration uses {{secrets/scope/key}}, which needs a compute restart after rotation.
  • Service principals give API-only access for automation and job runs without depending on users. Databricks-managed ones suit Databricks automation; Microsoft Entra ID-managed ones suit cases that also need other Azure resources. Setting Run as needs the service principal user role. OAuth M2M uses host, client_id and client_secret, and a scoped secret limits which APIs can be called.
  • Unity Catalog reaches Azure Data Lake Storage through the managed identity of an access connector for Azure Databricks, either system-assigned or user-assigned. You grant it Storage Blob Data Contributor, create a storage credential with the connector ID and an external location that uses it. Compared with a service principal, it avoids secret rotation and can reach storage behind network rules.

Govern Unity Catalog objects

  • Comments describe Unity Catalog catalogs, schemas, tables, columns and volumes and help data discovery: write them with COMMENT ON, ALTER TABLE ... ALTER COLUMN ... COMMENT, or the COMMENT clause when creating the object. Commenting on a table requires ownership or MODIFY and SELECT; on a view only ownership works. AI-generated comments must be reviewed before saving and are not a way to detect PII.
  • ABAC applies row filters and column masks based on governed tags: a policy created with CREATE POLICY on a catalog, schema or table uses WHEN to select tables and MATCH COLUMNS to select columns, which must be tagged directly. It applies automatically to new tagged tables, EXCEPT exempts principals, and it does not grant SELECT: users still need a direct grant.
  • A row filter is a SQL UDF that returns a boolean and is bound with ALTER TABLE ... SET ROW FILTER ... ON (columns); a column mask receives the value as its first parameter and is bound with ALTER COLUMN ... SET MASK, using USING COLUMNS for other columns. Both survive a table replace but block time travel and clones. Keep UDFs simple and match parameter types to the column types.
  • Delta table retention is set with two properties: delta.logRetentionDuration sets how much history is kept and delta.deletedFileRetentionDuration sets when VACUUM may delete unreferenced data files. Time travel needs both, and longer data retention raises storage costs. To erase data on tables with deletion vectors, run REORG TABLE ... APPLY (PURGE) and then VACUUM.
  • Unity Catalog captures lineage automatically down to the column level and aggregates it across the workspaces of the metastore. In Catalog Explorer, the Lineage tab shows the graph and the consuming jobs or dashboards, and the History tab shows who wrote and when. The system.access.table_lineage and column_lineage system tables let you query it with SQL; lineage is not preserved when objects are renamed.

3. Prepare and process data

30–35%

Design and implement data modeling in Unity Catalog

  • Extraction can be full or incremental: a query-based connector uses a cursor column that increases monotonically and changes on every insert or update, while CDC reads the change log and captures every intermediate state with less load on the source. Each file format has its options: header and sep for CSV, multiline for JSON, rowTag for XML; Parquet carries its own schema.
  • Databricks recommends starting with the most managed layer: Lakeflow Connect connectors for SaaS apps and databases provide incremental ingestion, retries and automatic schema evolution. When a source has no connector or needs custom logic, use notebooks. Azure Data Factory fits when orchestration already lives there: the Copy activity writes to Delta Lake and Databricks activities run notebooks or jobs.
  • With batch semantics the engine processes all available data on every run and results are always accurate; streaming processes only new data thanks to checkpoints and supports lower latency. Databricks recommends streaming for bronze ingestion and batch (materialized views) for gold aggregations. The availableNow trigger processes what is available as an incremental batch and then stops.
  • Delta Lake is the default format: Parquet files plus a transaction log with ACID, usable for batch and streaming. Unity Catalog managed tables use Delta or Iceberg (USING iceberg); CSV, JSON or Avro only work as external tables. To let Iceberg clients read a Delta table you enable Iceberg reads, which are incompatible with deletion vectors.
  • Most tables do not need partitioning: unpartitioned Delta tables use ingestion time clustering, and Databricks recommends liquid clustering. If you partition, use top-level, low-cardinality columns such as a date, never timestamps or IDs. Delta tracks partitions by itself; query with WHERE instead of partition paths, and you cannot Z-order on a partition column.

Ingest data into Unity Catalog

  • Lakeflow Connect offers managed connectors that create serverless ingestion pipelines writing to streaming tables. Database connectors add a continuous ingestion gateway that stages changes in a volume; the ingestion pipeline is scheduled with a job. scd_type selects type 1 or type 2, and a full refresh erases history. Streaming connectors such as Kafka ingest continuously.
  • In a notebook, spark.read loads files in batch and df.write.saveAsTable creates a Unity Catalog Delta table; append mode adds rows matching columns by name, overwrite replaces, ignore skips and the default mode fails if the table exists. spark.readStream over files needs an explicit schema, and a streaming read of a Delta table accepts only appends unless you set skipChangeCommits.
  • CTAS creates and fills a table from a query result; CREATE OR REPLACE TABLE replaces data and definition while keeping history and grants, and cannot use IF NOT EXISTS. COPY INTO loads files into a Delta table idempotently (already loaded files are skipped even if changed, unless force is set), filters with FILES or PATTERN and can infer the schema with mergeSchema. read_files queries files as a table.
  • The Delta change data feed is read with table_changes or readChangeFeed and adds _change_type (insert, update_preimage, update_postimage, delete), _commit_version and _commit_timestamp; batch reads need a starting version. In Lakeflow Spark Declarative Pipelines, AUTO CDC applies a change feed using KEYS and SEQUENCE BY, and AUTO CDC FROM SNAPSHOT compares snapshots when no CDC feed exists.
  • Each Structured Streaming query needs its own checkpointLocation, which stores offsets, commits and state; changing subscribed topics or aggregation keys requires a new checkpoint. availableNow processes available data as an incremental batch (and is recommended on serverless), processingTime sets the polling frequency, and Delta sinks support append and complete; upserts use MERGE in foreachBatch.

Cleanse, transform, and load data into Unity Catalog

  • To profile data, the display() data profile and dbutils.data.summarize show per-column statistics and histograms; summary() adds approximate quartiles to what describe() returns, and in SQL approx_percentile and approx_count_distinct estimate medians and cardinality. Unity Catalog data profiling stores metrics per time window or snapshot and measures drift against a baseline table.
  • Choose DECIMAL(p,s) for exact amounts (p is total digits and s the digits after the point), because DOUBLE and FLOAT are base-2. TIMESTAMP is an absolute instant shown in the session time zone and TIMESTAMP_NTZ is a local wall-clock value without a zone. For changing JSON, VARIANT performs better than strings; STRUCT enforces well-known schemas, and identity columns must be BIGINT.
  • For batch duplicates use dropDuplicates on the key columns or QUALIFY row_number() to keep the latest row; in streaming, dropDuplicatesWithinWatermark with withWatermark keeps state bounded. For nulls use fillna (with a dict when types differ), dropna, coalesce or nvl; remember that aggregates skip NULL except count(*), DISTINCT groups NULLs together and col = NULL is never true.
  • WHERE filters rows before grouping and rejects aggregates; HAVING filters the groups produced by GROUP BY and can use aggregate aliases; QUALIFY filters window function results. A FILTER clause on an aggregate limits the rows passed to that function only. ROLLUP, CUBE and GROUPING SETS compute several aggregation levels in one statement, and GROUP BY ALL groups by every non-aggregated expression.
  • LEFT SEMI and LEFT ANTI joins return only left-side columns: the rows that have a match, or the rows that do not. UNION, INTERSECT and EXCEPT default to DISTINCT and match columns by position; ALL keeps duplicates. In PySpark, union also matches by position, unionByName matches by name (allowMissingColumns fills nulls), subtract equals EXCEPT DISTINCT and exceptAll keeps duplicates.

Implement and manage data quality constraints in Unity Catalog

  • On Delta tables, NOT NULL and CHECK are enforced: if a row violates them the whole transaction fails, and existing rows are verified when they are added. CHECK allows deterministic functions but not UDFs, aggregates or window functions. Primary, foreign and unique keys are informational (RELY only helps the optimizer), so cardinality is validated with queries such as GROUP BY with HAVING count(*) > 1.
  • With ANSI mode, CAST raises errors such as CAST_INVALID_INPUT, while try_cast returns NULL. On insert, the ANSI store assignment policy rejects invalid casts without partial writes. When reading CSV or JSON with an explicit schema, PERMISSIVE inserts nulls, DROPMALFORMED drops and FAILFAST aborts; rescuedDataColumn keeps mismatched values and badRecordsPath saves bad records to files.
  • Delta tables enforce schema on write: columns must exist and types are cast only when safe. For drift, use mergeSchema or WITH SCHEMA EVOLUTION on each write, which add columns at the end; overwriteSchema rewrites the table. Column mapping enables metadata-only renames and drops, and type widening changes, for example, INT to BIGINT without rewriting files.
  • Expectations are named SQL Boolean constraints on streaming tables, materialized views and views. The warn action (default) writes invalid records, drop (ON VIOLATION DROP ROW) removes them and fail (FAIL UPDATE) rolls back the update. In Python, expect_all_or_drop applies a dictionary of rules. To review invalid records, use the quarantine pattern with a flag column.

4. Deploy and maintain data pipelines and workloads

30–35%

Design and implement data pipelines

  • The medallion architecture orders data from bronze to silver to gold. Bronze is appended incrementally with minimal validation and keeps history for reprocessing; silver is built from bronze (not directly from ingestion) with cleansing, deduplication and type casting; gold aggregates for the business. In a declarative pipeline, execution order comes from the dependencies between datasets.
  • Databricks recommends Lakeflow declarative pipelines for most new ETL: you declare tables and flows, and the engine resolves dependencies, incremental processing, checkpoints and retries. Spark notebooks orchestrated with Lakeflow Jobs fit when you need fine-grained control, manual tuning, rules that are hard to express declaratively, or functions that pipelines do not support, such as pivot().
  • Task dependencies form a directed graph, and Run if decides when each task runs (All succeeded by default, All done, At least one failed and so on). If/else branches on parameters or task values ({{tasks.<task>.values.<key>}}); == compares strings while > or < compare numbers. For each repeats a nested task over a list with configurable concurrency.
  • A notebook called with dbutils.notebook.run() that fails or exceeds timeout_seconds raises an exception that the caller can catch with try/except and retry. In taskValues.get(), debugValue supports testing outside a job, while a default hides errors. In pipelines, Refresh failed tables reprocesses only what failed, and an incompatible checkpoint is recovered by resetting it or with a full refresh.
  • To chain notebooks with conditions, dbutils.notebook.run(path, timeout_seconds, arguments) starts an ephemeral job, passes arguments as widget values and returns the string given to dbutils.notebook.exit(), enabling if-then-else flows; several values are returned as JSON. %run only runs another notebook inline and cannot return values. For production, Databricks recommends orchestrating with Lakeflow Jobs.

Implement Lakeflow Jobs

  • A Lakeflow job needs at least one task, a compute resource (serverless, classic jobs or all-purpose) and a unique name; a schedule is optional. It runs with the privileges of its Run as identity, even when another user starts it. Job-level settings include parameters, tags, queueing, maximum concurrent runs and shared job clusters, whose libraries are declared on each task.
  • Besides schedules, a job can start on file arrival in a Unity Catalog volume or external location, on table updates (any or all tables; the Run as identity needs SELECT) or continuously. The Wait after last change and Minimum time between triggers options control how often runs start. A continuous job has a single active run and restarts with exponential backoff after failures.
  • The scheduled trigger supports a simple schedule (interval and unit, without choosing the first run time) or an advanced one (period, time and time zone, with Quartz cron syntax). For exact hourly runs, use UTC, because daylight saving time can skip or delay runs. Pausing the trigger lets active runs finish; in a bundle you use quartz_cron_expression, timezone_id and pause_status.
  • Jobs and their tasks can notify by email or system destinations (Teams, Slack, webhooks, configured by an administrator) on start, success, failure, or when a duration or streaming backlog threshold is exceeded. Job-level notifications are not sent for task retries, and Succeeded with failures counts as success. Pipeline tasks do not support backlog alerts.
  • Task retries are set with a retry policy (maximum retries, an interval measured from the start of the failed attempt, retry on timeout); on serverless, auto-optimization retries unless you turn it off. Continuous jobs cannot use retry policies and retry with exponential backoff. Pipeline updates started by jobs retry automatically; ad hoc editor updates do not.

Implement development lifecycle processes in Azure Databricks

  • Each developer uses their own Git folder and branch; production Git folders are updated only by automation and users get Can Run. Version notebooks, source files and databricks.yml, but not build artifacts (upload them to volumes), tokens or PII files (.gitignore). Sparse checkout clones only the directories in its cone patterns.
  • In Git folders, merge neither rewrites history nor force pushes, while rebase and reset run git push --force; reset discards all changes on the branch. Without permission on main, create a branch and open a pull request in the Git provider. Databricks recommends trunk-based, short-lived feature branches and resolving conflicts in the Git folders UI.
  • Databricks describes testing layers: pytest unit tests of src modules on every pull request, using fake rather than production data; bundle validation and a non-production deployment; and end-to-end integration tests in a staging workspace that mirrors production, which act as the gate before promotion to production.
  • Declarative Automation Bundles (formerly Databricks Asset Bundles) are defined in a single databricks.yml that can include other YAML files and declares resources, variables and targets. Development mode adds name prefixes and pauses schedules; production mode validates the Git branch and pipelines. Variables resolve at deploy time: --var, BUNDLE_VAR_, overrides file, target, then default.
  • With the CLI, databricks bundle deploy -t <target> deploys the bundle and tracks resources by ID, so anything removed from the configuration is deleted; bundle run starts jobs (--only, --restart, --params) and bundle destroy deletes them. For CI/CD, use a service principal with OAuth or workload identity federation, without long-lived secrets.

Monitor, troubleshoot, and optimize workloads in Azure Databricks

  • Consumption is analysed with system.billing.usage (DBUs per SKU, custom tags, job_id only for job or serverless compute) and the system.compute tables (clusters for configuration history, node_timeline for minute-level utilization). Custom tags attribute cost, budgets email when monthly thresholds are exceeded, and the compute metrics UI shows CPU and memory per cluster.
  • The matrix view and run details show which task failed and why. A repair re-runs only the unsuccessful tasks and their dependents from the beginning, with the current settings, and only for jobs with two or more tasks, so tasks should be idempotent. Continuous jobs are restarted to apply changes, and Run now accepts different settings or a subset of tasks.
  • Start with the Spark UI jobs timeline: gaps with an overloaded driver point to non-Spark code or too much concurrency, and a stage with a single task points to coalesce(1) or windows without PARTITION BY. For ExecutorLostFailure, double the memory per core to confirm a memory issue. After %pip, run dbutils.library.restartPython(); restarting compute applies the latest images.
  • On the stage page, spill statistics mean execution memory ran short (try spark.sql.shuffle.partitions=auto), and a Max duration far above the 75th percentile means skew, which AQE splits in shuffle joins when both thresholds are exceeded. The DAG and the query profile reveal expensive operators and exploding joins; the disk cache speeds up repeated reads without code changes.
  • OPTIMIZE compacts small files without changing the data and accepts a WHERE on partition columns to limit cost; VACUUM deletes unreferenced files outside the retention period, supports DRY RUN and FULL and LITE modes, and its delete phase runs only on the driver. Predictive optimization runs OPTIMIZE, VACUUM and ANALYZE on Unity Catalog managed tables.