Databricks Certified Associate Developer for Apache Spark — Question 91

The code block shown below should read a CSV at the file path filePath into a DataFrame with the specified schema schema. Choose the response that correctly fills in the numbered blanks within the code block to complete this task.

Code block:

__1__.__2__.__3__(__4__).format("csv").__5__(__6__)

Answer options

Correct answer: E

Explanation

The correct answer is E because it properly utilizes the Spark DataFrameReader's method to read a file with a specified schema. The other options either use incorrect methods or parameters that do not correspond to reading a CSV file into a DataFrame.