Databricks Data Engineer Professional · Section 3 · 12% of the exam
Apply advanced data transformations, including window functions, joins, and aggregations, using Spark SQL and PySpark to process large datasets.
One of the objectives of the Databricks Certified Data Engineer Professional exam, in the section “Data Manipulation”. Here is what it covers, the points to remember and a question to try.
What it covers
Write correct and scalable transformations in Spark SQL and PySpark: window frames and ranking for deduplication, running totals and gaps; join types and strategies, hints, AQE and skew; and multi-level aggregations with GROUPING SETS, ROLLUP, CUBE, FILTER and approximate functions.
Points to remember
- Default frame with ORDER BY: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW (ties included); without ORDER BY: the whole partition.
- Use ROWS frames for running totals and moving averages;
last_valueneeds an explicit frame to see later rows. - Dedup pattern:
QUALIFY row_number() OVER (PARTITION BY key ORDER BY ts DESC, tiebreaker) = 1. - A window without PARTITION BY sends all rows to one partition: avoid it on large tables.
- Semi join = EXISTS (left columns only, no duplicates); anti join = NOT EXISTS (orphans);
<=>is null-safe equality.
Try a question
A data engineer must list the customers in prod.silver.dim_customer who have never placed an order in prod.silver.orders. The output must contain only customer columns, one row per customer. Which join is the most direct choice?
- A
LEFT SEMI JOINfrom customers to orders oncustomer_id - B
FULL OUTER JOINoncustomer_idfiltered onorders.order_id IS NULL - C
LEFT ANTI JOINfrom customers to orders oncustomer_id - D
CROSS JOINwith aWHERE customers.customer_id <> orders.customer_idfilter
Show the answer
C. A left anti join returns the left rows that have no match on the right (NOT EXISTS), with only the left columns and without duplicating rows. It is the standard pattern for orphan and missing-member checks.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Window Functions, Joins and Aggregations at Scale teaches this objective (about 50 minutes), and 13 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.
More in this section
- Develop a model and query semi-structured data using the VARIANT data type and related functions (e.g., parse_json, variant_get).
- Apply AI functions, including ai_query, to perform model inference within data pipelines for enrichment and classification tasks.
- Implement data quality expectations in Lakeflow Pipelines to quarantine, drop, or fail on bad records.