Databricks Certified Associate Developer for Apache Spark — Question 113

Which of the following code blocks writes DataFrame storesDF to file path filePath as parquet and partitions by values in column division?

Answer options

Correct answer: D

Explanation

Option D is correct because it correctly uses the partitionBy method followed by the parquet method to save the DataFrame in the desired format and partitioning. Options A, B, C, and E are incorrect as they either misuse method chaining or do not follow the correct syntax for saving a DataFrame as parquet with partitioning.