Databricks Certified Associate Developer for Apache Spark — Question 130

The code block shown below should return a new 12-partition DataFrame from DataFrame storesDF. Choose the response that correctly fills in the numbered blanks within the code block to complete this task.

Code block:

__1__.__2__(__3__)

Answer options

Correct answer: D

Explanation

The correct answer is D because the repartition method is used to increase the number of partitions, in this case to 12. Option A and B use coalesce, which is intended for reducing partitions, while C incorrectly suggests using a column name instead of a partition count.