Databricks Data Engineer Associate · CHEAT SHEET
Databricks Certified Data Engineer Associate
Key concepts grouped by official exam weight.
Download as PDF (free, no sign-up)1. Databricks Intelligence Platform
6–6%Databricks Intelligence Platform
- Databricks separates a control plane, managed in the Databricks account, from a compute plane: classic in the customer's cloud account or serverless in the Databricks account. Delta Lake adds a transaction log to Parquet files for ACID, schema enforcement and version history. Unity Catalog governs tables, volumes and lineage from a regional metastore shared by several workspaces.
- Serverless compute for notebooks, jobs and pipelines is managed by Databricks and minimizes idle time, but it does not support R, the Spark UI or interval-based streaming triggers. Classic all-purpose or job compute is configured with standard or dedicated access mode, autoscaling, auto termination and pools. Serverless, pro or classic SQL warehouses run SQL workloads with Photon.
2. Data Ingestion and Loading
21–21%Data Ingestion and Loading
- Lakeflow Connect provides managed connectors for SaaS applications and databases, which create incremental ingestion pipelines into streaming tables, and standard connectors built on SQL and Spark APIs such as Auto Loader, COPY INTO or Kafka. Small local files are loaded through the file upload page or into a volume. Triggered pipelines process available data and stop; continuous mode processes data as it arrives.
- COPY INTO loads files from a location into an existing Delta table in a retriable, idempotent way: it skips files already loaded unless the force option is used. It supports FILES or PATTERN filters, SELECT transformations, VALIDATE and mergeSchema to infer and evolve the schema. With Unity Catalog it requires READ VOLUME on the volume or READ FILES on the external location, plus USE CATALOG and USE SCHEMA.
- Auto Loader (the cloudFiles source) ingests new files incrementally with exactly-once guarantees. With cloudFiles.schemaLocation it infers and evolves the schema: addNewColumns stops the stream to add columns, rescue stores them in _rescued_data, and schema hints fix types. Batch runs use Trigger.AvailableNow in Lakeflow Jobs, and file discovery uses directory listing or file notifications with file events.
- Lakeflow Connect managed connectors use a Unity Catalog connection, a serverless ingestion pipeline and destination streaming tables; database connectors add a continuous ingestion gateway on classic compute and a staging volume. Pipeline creators need USE CONNECTION plus catalog and schema privileges, history tracking is enabled with SCD_TYPE_2, and pipelines deploy with Declarative Automation Bundles.
- A JDBC Unity Catalog connection stores the driver, URL and credentials; it is read with the databricks.connection option or remote_query, and externalOptionsAllowList limits user options. Parallel reads use partitionColumn, lowerBound, upperBound and numPartitions. REST APIs use HTTP connections or secrets read with dbutils.secrets.get, land files in volumes and run on Lakeflow Jobs schedules.
3. Data Transformation and Modeling
22–22%Data Transformation and Modeling
- The silver layer reads bronze tables, preferably as streams, and cleans them: dropna with subset, how or thresh for nulls, fillna and replace with matching types, coalesce for defaults and dropDuplicates on key columns, with a watermark when streaming. Types are standardized with to_date and a format, and try_cast, which returns NULL instead of failing on malformed values.
- Joins combine rows on a condition: INNER returns only matches, LEFT keeps the left table with NULLs, SEMI and ANTI filter by existence, and CROSS JOIN, or a join without ON, produces the Cartesian product. broadcast() or the BROADCAST hint avoids shuffling the large table. UNION removes duplicates and UNION ALL keeps them; in PySpark union is positional and unionByName matches by name.
- In PySpark, withColumn adds columns, withColumnRenamed renames them (silently, if the name does not exist), drop returns a DataFrame without them, and filter or where keeps the matching rows. split returns an array and split_part a single part; explode creates one row per element and explode_outer keeps NULL or empty arrays. In Delta tables, metadata-only renames and drops require column mapping.
- dropDuplicates removes duplicates by comparing all columns or a subset, and on a stream it needs a watermark to bound state; a MERGE with only WHEN NOT MATCHED avoids reinserting records, but the batch must be deduplicated first. count(*) includes NULLs and count(col) does not; approx_count_distinct estimates uniques with HyperLogLog++; avg or mean ignore NULLs; summary adds quartiles to describe.
- spark.sql.shuffle.partitions sets partitions for DataFrame and SQL shuffles, and on Databricks the value auto lets AQE size them; spark.default.parallelism only affects RDDs. spark.sql.autoBroadcastJoinThreshold caps broadcasting (-1 disables it) and a BROADCAST hint forces it for one query. Driver memory comes from the driver type. After each change, re-measure in the Spark UI.
4. Working with Lakeflow Jobs
16–16%Working with Lakeflow Jobs
- Lakeflow Jobs controls flow with retry policies (max_retries, retry interval and retry_on_timeout), Run if dependencies (All succeeded, All done, At least one failed and others), the If/else condition task, which branches on task values or parameters, and the For each task, which runs a nested task once per input. Repairs re-run only failed tasks and their dependents, from the start.
- A Lakeflow Jobs job is a DAG of tasks: notebook, SQL (query, alert or .sql file on a serverless or pro SQL warehouse), dashboard (refreshes a published dashboard and notifies subscribers) and pipeline (one update per run, or continuous when the job is continuous). Dependencies are set with depends_on, and the Run if condition decides whether a task runs based on upstream results.
- Lakeflow Jobs triggers include scheduled (simple, or advanced with Quartz cron and a time zone; UTC avoids daylight saving gaps), file arrival (Unity Catalog volume or external location, no wildcards, recursive) and table update (any or all tables, with SELECT for the Run as identity). The minimum time between triggers and wait after last change options control how often runs start.
- Use a schedule when the requirement is a fixed clock time or the source sends no change signal; use file arrival or table update triggers when data lands at unpredictable times, with no always-on cluster and no knowledge of upstream processes. For low latency use a continuous job, and when tasks depend on each other within one team, use task dependencies in a single job instead of chained schedules.
5. Implementing CI/CD
10–10%Implementing CI/CD
- Git folders (formerly Databricks Repos) are a Git client inside the workspace: you clone with CAN MANAGE on the parent folder and use the Git dialog to create and switch branches, pull, and Commit & Push. If you cannot commit to main, work on another branch and open the pull request in the Git provider; each person uses their own folder and branch, and Merge does not rewrite history, unlike Rebase and Reset.
- Custom variables are declared under variables and used as ${var.name}; their value comes, in order, from --var, BUNDLE_VAR_, variable-overrides.json, the target's variables mapping and the default. They are deployment-time (use job parameters per run), support type: complex and ID lookups, and targets settings join top-level ones by task_key or job_cluster_key, with the target taking precedence.
- A bundle has a single databricks.yml that includes resource files (include) and defines jobs, pipelines and code as source; each target can set mode, presets, permissions and run_as. Development mode prefixes [dev user], pauses schedules and disables the lock; production mode validates the Git branch and requires pipelines development: false. Deployments track resources by ID, and changing name, target or workspace breaks the association.
- The Databricks CLI drives the bundle lifecycle: validate checks configuration, plan previews changes without applying them, deploy -t deploys to a target, run starts jobs or pipelines (--only, --params, --validate-only) and destroy --auto-approve removes deployed resources. generate and deployment bind adopt existing resources; CI uses a service principal with environment variables or workload identity federation.
6. Troubleshooting, Monitoring, and Optimization
10–10%Troubleshooting, Monitoring, and Optimization
- The matrix view on the Runs tab shows run and task history with bars whose height indicates duration, and warns when a run exceeds the expected completion time (Run duration Warning threshold). The phase breakdown (Queued, Waiting for resources, Library installation, Running) shows where time grows; for baselines beyond 60 days, query the system.lakeflow tables.
- Run status depends on leaf tasks: Succeeded with failures when tasks fail but all leaf tasks succeed, Failed when a leaf task fails, Skipped when maximum concurrent runs is exceeded. The Graph view shows the DAG to find the task blocking Upstream failed tasks, Timeline reveals slow and overlapping tasks, and the Runs tab gives the finished runs graph and the top five error types.
- In the Spark UI, start with the jobs timeline, open the longest stage and read its Input, Output, Shuffle Read and Shuffle Write columns and its task count. Skew shows when the Max duration in Summary Metrics is far above the 75th percentile; spill appears in the stage details and is reduced with spark.sql.shuffle.partitions=auto, less data in memory or more executor memory.
- Liquid clustering (CLUSTER BY) replaces partitioning and ZORDER, lets you change keys without rewriting data and is incremental; OPTIMIZE FULL reclusters existing data and CLUSTER BY AUTO lets Databricks pick keys. Predictive optimization runs OPTIMIZE, VACUUM and ANALYZE only on Unity Catalog managed tables, inheriting from account to catalog, schema and table.
- A cluster-scoped init script that returns a non-zero exit code fails the launch; diagnose it with cluster log delivery and the init script logs. For library conflicts, %pip installs notebook-scoped libraries and dbutils.library.restartPython() loads the new version. For lost executors, check the event log first; verify memory issues by doubling memory per core, and a large collect() needs a driver with more memory.
7. Governance and Security
15–15%Governance and Security
- Unity Catalog managed tables (Delta Lake or Iceberg) store data in the schema, catalog or metastore managed location, optimize themselves and delete their files after DROP TABLE once the recovery period ends. External tables use LOCATION on an external location, and DROP removes only metadata. ALTER TABLE ... SET MANAGED converts an external table while keeping its name, grants and history.
- Unity Catalog uses GRANT and REVOKE, from SQL or the Catalog Explorer permissions tab; reading a table requires USE CATALOG, USE SCHEMA and SELECT. Privileges on catalogs and schemas inherit to current and future objects, while metastore grants do not. MANAGE delegates grant management without data access, and the DENY statement applies only to hive_metastore.
- A row filter is a boolean SQL UDF bound with ALTER TABLE ... SET ROW FILTER that excludes rows where it returns FALSE; a column mask (SET MASK, with USING COLUMNS for extra columns) replaces values. Use is_account_group_member for account groups. ABAC policies on governed tags scale across many tables, and dynamic views serve joined data to users without base table access.
- Unity Catalog ABAC policies apply row filters and column masks from a catalog or schema to every table whose governed tags meet their conditions (WHEN and MATCH COLUMNS), using a UDF and TO/EXCEPT clauses; they cover new tables and table owners cannot remove them. They do not grant access: a direct SELECT grant is still needed.