Databricks Certified Associate Developer for Apache Spark — Question 111

Which of the following code blocks writes DataFrame storesDF to file path filePath as CSV?

Answer options

Correct answer: C

Explanation

The correct answer is C because it directly calls the csv method on the write object to save the DataFrame as a CSV file at the specified path. The other options either have incorrect method chaining or use methods that do not conform to the expected syntax for writing a DataFrame as CSV.