Wide Transformations: When Rows Must Come Together

A wide transformation is one where an output partition needs data from many input partitions. The classic example is groupBy. To sum profit per region, every row for a given region has to end up in the same place so it can be added together, but those rows are scattered across every partition on every machine. Spark has to gather all the rows for each region together first, and that gathering pulls data from everywhere. Join is the same story. To match orders to products on a product id, every order and every product sharing that id must meet on the same machine, and since they started life spread across the cluster, they have to be brought together by key. distinct must compare rows from all partitions to find duplicates. Each of these operations has the same defining feature: the output

About This Interactive Section

This section is part of the Narrow, Wide, and the Shuffle lesson on DataDriven, a free data engineering interview prep platform. Each section includes explanations, worked examples, and hands-on code challenges that execute in real time. SQL queries run against a live PostgreSQL database. Python runs in a sandboxed Docker container. Data modeling problems validate against interactive schema canvases. All content is framed around what data engineering interviewers actually test at companies like Meta, Google, Amazon, Netflix, Stripe, and Databricks.

How DataDriven Lessons Work

DataDriven combines four interview rounds (SQL, Python, Data Modeling, Pipeline Architecture) with adaptive difficulty and spaced repetition. Easy problems get harder as you improve. Weak concepts resurface until you master them. Your readiness score tracks progress across every topic interviewers test. Every lesson section ends with problems you solve by writing and running real code, not by picking multiple-choice answers.