DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK · Question #138
Which of the following DataFrame operations is classified as a wide transformation?
The correct answer is B. DataFrame.join(). DataFrame.join() is a wide transformation because it requires a shuffle - data must be redistributed across partitions so that rows with matching keys are co-located before the join can execute. This cross-partition data movement is the defining characteristic of wide (shuffle)…
Question
Which of the following DataFrame operations is classified as a wide transformation?
Options
- ADataFrame.filter()
- BDataFrame.join()
- CDataFrame.select()
- DDataFrame.drop()
- EDataFrame.union()
How the community answered
(38 responses)- B92% (35)
- C5% (2)
- E3% (1)
Explanation
DataFrame.join() is a wide transformation because it requires a shuffle - data must be redistributed across partitions so that rows with matching keys are co-located before the join can execute. This cross-partition data movement is the defining characteristic of wide (shuffle) transformations in Spark.
The distractors are all narrow transformations: filter() evaluates each row in place, select() and drop() project columns within each partition, and union() simply concatenates two DataFrames without redistributing data - no shuffle is triggered by any of them.
Memory tip: Think "wide = data travels wide across the cluster." Any operation that must group or match rows from different partitions (like joining on a key, grouping, or distinct) is wide. Operations that work row-by-row or column-by-column within a partition stay narrow.
Topics
Community Discussion
No community discussion yet for this question.