A data engineer creates a large Spark DataFrame, df, with 1,000 partitions and needs to decrease it to 100 partitions.
Which method offers the ability to reduce the number of partitions without reshuffling data between them?
A Spark developer is building a Spark application to monitor task performance throughout a cluster. One application requirement is to track the maximum processing time for tasks on every worker node and consolidate this data on the driver for further analysis.
Which technique should the developer use to accomplish this?
Community Discussion
A data engineer is working on a Spark job that must join multiple DataFrames. Given this code snippet that performs the joins:
data1 = [Row(id=1, value=”A”)]
df1= spark.createDataFrame (datal)
data2 = [Row(id=1, description= “Descl”)]
df2 = spark.createDataFrame (data2)
data3 = [Row(id=1, details="Details1")]
df3 spark.createDataFrame (data3)
joined df = df1.join (broadcast (df2), df1.id == df2.id, “inner”) .join (broadcast (df3), df2.id == df3.id, “inner”)
What output will this code produce?
Community Discussion
The code block below contains a logical error that results in inefficiency. It is intended to efficiently perform a broadcast join of DataFrame storesDF and the much larger DataFrame employeesDF using key column storeId. Identify the logical error.
Code block:
storesDF.join(broadcast(employeesDF), "storeId")
Community Discussion
A data engineer is developing a Spark application containing two DataFrames:
- DataFrame A holds detailed transaction records from the last year and is 128 GB in size.
- DataFrame B holds a lookup table of user details and is 1 GB in size.
For performance optimization, the developer chooses to use a broadcast join.
Which approach should the engineer use to choose the DataFrame to broadcast?





Community Discussion