Databricks Certified Associate Developer for Apache Spark — Question 104

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

Code block:
__1__.__2__.__3__(__4__)

Answer options

Correct answer: E

Explanation

The correct answer is E because 'spark.read.load(filePath)' is the appropriate method to read a parquet file into a DataFrame. Option A incorrectly uses 'parquet' instead of 'load', while B uses 'read()' which is not the correct method format. Option C adds an unnecessary 'source' parameter, and D incorrectly names the DataFrame variable.