Back to exam

DP-750 Cheatsheet

Implementing Data Engineering Solutions Using Azure Databricks

Download free PDF

Configure the Azure Databricks environment

Compute for each workload

  • **All-purpose compute** supports interactive development. **Job compute** runs automated workloads with a job-managed lifecycle. Isolate production ingestion from development activity.
  • **Serverless compute** reduces infrastructure administration for supported jobs and pipelines. **SQL warehouses** serve SQL and BI workloads; choose serverless SQL where available and suitable.
  • **Lakeflow Spark Declarative Pipelines** manages its own pipeline compute. Select serverless or configure supported classic pipeline compute and autoscaling through pipeline settings.
  • **Autoscaling** changes worker count within configured limits. **Auto-termination** shuts down idle compute. Set both when workloads vary and interactive clusters may be left unused.
  • **Right-size** from CPU, memory, spill and runtime measurements. Predictably underused compute may need fewer workers; validate the completion window after resizing. Pools can reduce classic compute startup time.

Runtime, libraries and compute access

  • **Photon** accelerates supported SQL and DataFrame operations. It complements appropriate sizing and scaling; it does not configure autoscaling or schema evolution.
  • **Databricks Runtime ML** packages common ML libraries. A single-node configuration has no separate worker machines; distributed execution needs multiple nodes, and GPU acceleration needs compatible GPU hardware and runtime.
  • **Compute-scoped libraries** are installed for the cluster; **notebook-scoped %pip** dependencies serve the notebook environment. Pin compatible versions and declare production dependencies with the workload.
  • **Unity Catalog volumes** can hold governed library files. Workspace files and package repositories are other supported sources; runtime and access mode determine library and allowlist requirements.
  • **CAN MANAGE** on compute permits attaching libraries and changing configuration. **CAN RESTART** permits lifecycle operations. Unrestricted compute creation is an entitlement; policies can limit permitted configurations.

Catalogs, schemas and storage objects

  • **Unity Catalog** organizes data as metastore, catalog, schema and object. Reference tables with **catalog.schema.table** to avoid dependence on session defaults.
  • **Catalogs** can separate departments or environments. **Schemas** can separate teams or data layers. Apply standard names and grants at boundaries that match ownership and isolation requirements.
  • **CREATE SCHEMA catalog.schema MANAGED LOCATION** sets schema-level managed storage. The cloud path must be authorized through Unity Catalog, with the required managed-storage privileges.
  • **Managed tables** delegate data and metadata lifecycle to Databricks. **External tables** register data at a specified location whose file lifecycle remains externally managed.
  • **Volumes** govern files such as CSVs, attachments and library packages; tables govern tabular datasets. A volume path is **/Volumes/catalog/schema/volume/**. A view stores a query; a materialized view stores maintained query results.

Federation and business discovery

  • **Lakehouse Federation** uses a Unity Catalog connection and foreign catalog to expose supported remote database objects for querying without first ingesting their data.
  • **Lakeflow Connect** ingests supported source data into destination tables. Choose federation for remote access and managed connectors for replicated data and incremental ingestion, subject to source support.
  • **Curated views** in a native catalog can reference foreign tables through three-level names. Keep business logic centralized while the foreign catalog represents the remote database.
  • **AI/BI Genie** uses space instructions, examples and metadata to interpret business terms. Put space-specific synonyms and query guidance in that space; use shared table and column descriptions for general discovery.

Secure and govern Unity Catalog objects

Least-privilege access

  • **Read a table:** grant USE CATALOG on its catalog, USE SCHEMA on its schema and SELECT on the table or view. Apply the same hierarchy to users, account groups and service principals.
  • **Write existing data:** grant MODIFY on the target plus parent usage privileges; operations that read table values also need SELECT. Table modification does not require CREATE TABLE on the schema.
  • **Create objects:** CREATE TABLE belongs on the schema; CREATE SCHEMA belongs on the catalog. Grant parent usage privileges too. Keep permission administration with designated owners or managers.
  • **Ownership** includes management rights over an object. A principal creating a table normally becomes its owner; schema-level creation privileges alone cannot guarantee that it will never manage grants on its own tables.
  • **Workspace ACLs** govern jobs, notebooks and compute separately from data privileges. CAN MANAGE RUN allows job run operations; SQL warehouse use also requires the applicable warehouse permission.

Storage identities and secrets

  • **Access Connector for Azure Databricks** supplies a managed identity. Grant that identity only the Azure Storage data access needed, scoped to the relevant container or path design.
  • **Storage credentials** represent cloud authentication. An **external location** binds a cloud URL to a credential. Create the connector and Azure permissions, then the credential and external location.
  • **READ VOLUME** permits file reads; WRITE VOLUME permits file changes. Include USE CATALOG and USE SCHEMA. For direct file access through an external location, use the applicable READ FILES or WRITE FILES privileges.
  • **Key Vault-backed secret scopes** reference centrally managed secrets. Retrieve values at runtime with dbutils.secrets.get(scope="scope", key="name"). Scope readers can access the scope's secrets; separate vaults or scopes where access boundaries differ.
  • **Service principals** give applications their own identity. Authorize both the compute endpoint and the required data objects; keep credentials out of notebooks, configuration committed to Git and logs.

Row filters, masks and governed tags

  • **Row filters** use SQL functions to restrict visible records. **Column masks** transform sensitive values at query time while allowing authorized users to query other columns and rows.
  • **Partial masks** can expose an email domain or the last four card digits. Combine table SELECT and parent usage privileges with the required masking policy; hiding rows would address a different requirement.
  • **Attribute-based access control** uses governed tags and centralized policies to apply supported row filters or masks to matching data. A tag classifies an object; the policy supplies enforcement.
  • **Data security** controls who sees information. Write-time constraints and pipeline expectations validate data quality; filtering query results does not reject invalid writes.

Lineage, audit and external sharing

  • **Catalog Explorer lineage** shows captured upstream and downstream relationships, including column lineage where supported. Use Unity Catalog-compatible compute; inspect owners, descriptions and history alongside dependencies.
  • **Audit logs** record who performed which action against which resource. The system.access.audit system table supports centralized investigation; verify event coverage when using Azure diagnostic logs.
  • **Azure Monitor diagnostic settings** route supported workspace logs to Event Hubs for streaming, Log Analytics for investigation and alerts, or Storage for economical retained archives. Configure coverage across every required workspace.
  • **Delta Sharing** exposes governed shares to recipients using their own compatible compute. Manage shared assets, recipient authorization and revocation centrally without granting general workspace access.

Retention and recoverable history

  • **Time travel** reads a retained snapshot with VERSION AS OF or TIMESTAMP AS OF. DESCRIBE HISTORY lists commits. Recoverability requires both the necessary transaction log and data files.
  • **delta.logRetentionDuration** controls retained log history. **delta.deletedFileRetentionDuration** sets the age threshold for obsolete files eligible for VACUUM. Use interval values, such as interval 30 days, and align both with the recovery window.
  • **VACUUM** removes eligible unreferenced data files; log cleanup follows Delta log retention separately. Changing a retention property alone does not perform physical cleanup. Preserve enough history for long-running readers and streams.
  • **Business record expiration** needs DELETE or another explicit data lifecycle process. VACUUM does not remove current rows simply because their event dates are old. Avoid storage lifecycle rules that delete live Delta table files.
  • **Predictive optimization** can automate maintenance for eligible Unity Catalog managed tables. Retention defines a cleanup threshold rather than an exact deletion deadline; plan cleanup cadence and any required physical purge separately.

Prepare and process data

Data layers and changing dimensions

  • **Bronze** preserves ingested data, **silver** cleanses and standardizes it, and **gold** applies business logic for consumption. Define a stable grain and keys for each curated dataset.
  • **Delta Lake** adds ACID transactions, schema controls and versioned table state to lake files. CSV and JSON suit interchange; Parquet supplies columnar storage but alone does not supply a Delta transaction log.
  • **SCD Type 1** overwrites attributes when history is unnecessary. **SCD Type 2** retains successive records with effective intervals or current-row indicators for historical analysis. **Type 0** preserves the original value.
  • **MERGE INTO** matches source and target keys for conditional updates, inserts and deletes. Deduplicate source changes and define ordering before applying CDC to a dimension; permanent history belongs in an SCD or archive table.

Choose an ingestion method

  • **Auto Loader** incrementally discovers files in cloud storage through the cloudFiles source. It suits repeated or near-real-time ingestion at scale and integrates with declarative pipelines.
  • **COPY INTO** loads files into an existing Delta table with concise SQL and tracks previously loaded files. Use FILEFORMAT = CSV and suitable FORMAT_OPTIONS for CSV; file tracking does not deduplicate business records.
  • **Lakeflow Connect managed connectors** reduce custom work for supported databases and applications. Configure source access, connectivity and any CDC prerequisites for the selected connector.
  • **Azure Data Factory** can orchestrate extraction from REST APIs and land files for Databricks processing. Notebooks suit custom parsing and transformations; choose a batch or streaming load according to freshness needs.
  • **INSERT INTO** and append writes preserve existing target rows. INSERT OVERWRITE replaces the applicable target data; CTAS creates a table from query results. Use MERGE when incoming data includes changes to existing records.

Schema enforcement and evolution

  • **Schema enforcement** rejects incompatible writes. **Schema evolution** permits supported changes such as new columns when explicitly enabled. Source parsing and target-table evolution are separate configuration decisions.
  • **cloudFiles.schemaLocation** persists Auto Loader's inferred schema. **checkpointLocation** persists streaming progress and state. Keep both durable and give each independent stream its own checkpoint.
  • **addNewColumns** can update the inferred schema and stop the stream for a restart. **failOnNewColumns** stops without evolving it. **rescue** captures unexpected fields instead of adding them to the schema.
  • **Rescued data** preserves unexpected fields or type mismatches for inspection where supported. Configure parsing and drift handling deliberately; target mergeSchema cannot discover fields already omitted by a fixed input schema.

Structured Streaming and Event Hubs

  • **readStream** defines an incremental source; writeStream defines the sink. Append mode adds output rows. A durable checkpoint records source offsets, commits and state so a compatible query can recover after failure.
  • **Exactly-once results** depend on a replayable source, preserved checkpoint and transactional or idempotent sink. A failed micro-batch may replay safely; checkpoints do not remove duplicate events already present in the source.
  • **Event Hubs** supports streaming ingestion through supported connectors, including its Kafka endpoint. The Event Hubs connector exposes binary body; the Kafka source exposes binary value. Decode the payload before parsing JSON.
  • **Authentication** depends on the chosen connector: configure the corresponding connection or security options and obtain secrets securely. A consumer group separates consumers; starting offsets choose the initial read position, not recovery state.
  • **AvailableNow** processes the data available for a bounded run and then finishes. A processing-time trigger polls on an interval where supported. **Watermarks** bound event-time state and late-data handling; they do not replace checkpoints.

Change data feed and lasting history

  • **Change data feed (CDF)** exposes inserts, deletes and update before/after images. Read it with readChangeFeed = true; use supported CDF configuration for the table and runtime.
  • **_change_type**, **_commit_version** and **_commit_timestamp** describe each change. Use startingVersion or startingTimestamp when initializing a read from a retained point, then checkpoints to track stream progress.
  • **skipChangeCommits** skips modifying commits and cannot propagate all changes. CDF consumers must explicitly apply update and delete semantics to the downstream target.
  • **CDF retention is finite.** Persist changes into an archive or SCD Type 2 table for long-term analysis. Time travel provides retained snapshots and does not itself create permanent business history.

SQL and DataFrame transformations

  • **Null handling:** df.dropna(subset=["amount"]) removes rows with a null amount; df.filter(df.amount.isNotNull()) expresses the same test. fillna replaces null values and retains the rows.
  • **GROUP BY** aggregates at the selected grain; HAVING filters grouped results. GROUP BY key HAVING COUNT(*) > 1 identifies duplicate keys. SELECT DISTINCT and dropDuplicates remove duplicates at their specified column scope.
  • **INTERSECT** returns common rows; EXCEPT returns rows in the left result absent from the right. Their default forms remove duplicates. UNION also removes duplicates, while UNION ALL preserves them.
  • **Joins** combine columns using match conditions; choose inner or outer semantics for unmatched records. Check key cardinality to avoid accidental row multiplication.
  • **Pivot** rotates distinct values into aggregate columns: groupBy("region").pivot("product").sum("sales"). **UNPIVOT** rotates named measure columns into a label column and a value column for long-form data.

Quality enforcement and profiling

  • **NOT NULL** enforces required values. **CHECK** enforces a Boolean rule such as amount BETWEEN 0 AND 10000. Violations fail the write transaction; pair range checks with NOT NULL when nulls are forbidden.
  • **Pipeline expectations** evaluate record-level SQL predicates. expect records quality metrics while retaining invalid rows; expect_or_drop excludes invalid rows and continues; expect_or_fail stops the affected flow's update.
  • **Quarantine** writes invalid records to a separate dataset while valid records continue to the clean table. Drop metrics are counts, not a retained copy of the rejected records.
  • **Quality metrics** are available through the pipeline UI or event log where supported. Use them to track accepted and dropped records; investigate failed updates through their error details.
  • **Snapshot profiles** summarize a table at refresh time. **Time-series profiles** compare statistics across timestamp windows. **Inference profiles** assess model prediction data; choose the type that matches the monitoring question.

Deploy and maintain pipelines and workloads

Declarative pipelines and notebooks

  • **Lakeflow Spark Declarative Pipelines** derives a data dependency graph from SQL or Python dataset definitions and manages execution, incremental state, quality rules and operational monitoring.
  • **Streaming tables** incrementally process new source records. **Materialized views** maintain query results and can suit analytical summaries. In pipeline SQL, CREATE OR REFRESH STREAMING TABLE declares a streaming dataset.
  • **Streaming aggregation** groups records and maintains state, such as totals by city. Choose compatible output semantics and state management; STREAM(source) makes a SQL input incremental.
  • **Notebook tasks** suit highly customized Python batch logic. Schedule them with Lakeflow Jobs and explicitly configure dependencies, retries and monitoring. Separate ingestion, cleansing and curation into focused steps.

Task graphs and failure recovery

  • **Depends on** establishes execution order. For ingestion followed by two independent transformations, make both transformations depend on ingestion without a dependency between them; they can then run in parallel.
  • **Run if: All succeeded** blocks a dependent task when an upstream task fails. Other conditions support cleanup or conditional branches; choose them according to the required success and failure paths.
  • **Task retries** recover transient failures within configured limits and delays. Retain upstream-success dependencies so downstream processing waits for successful ingestion.
  • **Repair run** reruns selected failed or skipped tasks and their necessary dependents without restarting all successful work. A full restart re-executes the workflow; make rerunnable writes idempotent.

Triggers, queues and notifications

  • **Scheduled triggers** follow a calendar; **file arrival triggers** react to detected new files at supported locations. Pair event-driven scheduling with ephemeral compute to avoid keeping a processing cluster idle.
  • **Continuous job mode** repeatedly runs a workload and manages failure backoff. It is distinct from Spark's continuous trigger. Serverless continuous jobs use supported bounded streaming triggers such as AvailableNow.
  • **Maximum concurrent runs = 1** serializes a job. Enable **queueing** when later scheduled runs must wait rather than be skipped; account for queue limits and backlog when setting the schedule.
  • **Job failure notifications** report overall run outcomes. **Task failure notifications** target specific critical tasks and can fire before the job finishes. For end-of-run critical-only alerts, explicitly evaluate critical outcomes in final workflow alerting logic.

Bundles and development lifecycle

  • **Declarative Automation Bundles** package code and resource definitions for repeatable deployments. The project's databricks.yml defines resources, variables, permissions and environment targets; keep it with the code in Git.
  • **targets** select development, test or production settings and resource definitions. Put resources used by only one environment under its target; shared top-level resources apply to targets unless properly overridden.
  • **Databricks CLI:** bundle init creates a project from a template; bundle validate checks configuration; bundle deploy --target dev deploys to dev; bundle run starts a deployed resource.
  • **Git merge** combines branch history. Resolve conflicts by merging current main into the feature branch, preserving intended edits from both sides, committing the resolution and then completing the merge into main.
  • **Git folders** support workspace collaboration but do not replace deployment automation. Promote tested artifacts through targets; use unit tests for logic and integration or end-to-end tests for pipeline behavior.

Diagnose Spark performance

  • **Spark UI** connects jobs, stages and tasks to runtime behavior. Use the DAG, stage metrics and executor logs to locate bottlenecks; SQL query profiles expose expensive query operators.
  • **Data skew** creates a few much larger tasks that delay a stage after most workers finish. Compare task duration, records and shuffle bytes; address hot keys or use suitable adaptive execution strategies.
  • **Shuffle** redistributes data for joins and aggregations. **Spill** writes intermediate data to disk when memory is insufficient. Compare partition sizes, shuffle volume and memory pressure before adding compute.
  • **Out-of-memory failures** require distinguishing driver pressure from executor pressure. Check large collect operations, oversized partitions, skew and joins; adjust the operation or partitioning before relying on a cluster restart.
  • **Caching** helps repeatedly reused data that fits the workload's memory budget. Release unused caches. Measure active resource use and processing time separately from idle compute costs.

Delta layout and maintenance

  • **Liquid clustering** organizes data around query filter columns and can adapt as requirements change. It replaces partitioning and Z-ordering on the same table; high-cardinality partition keys can produce many small partitions.
  • **Deletion vectors** mark row changes without immediately rewriting entire Parquet files. They reduce write amplification for supported operations; physical removal and retention still require appropriate maintenance.
  • **OPTIMIZE** compacts existing small files and can apply the table's clustering strategy. It preserves logical table data and retained history. Optimized writes and auto compaction help control future small-file accumulation.
  • **VACUUM** reclaims obsolete files after retention and can make older snapshots unavailable. Choose OPTIMIZE for current small-file performance and retention-aware VACUUM for storage reclamation.