Databricks Certified Associate Developer for Apache Spark — Question 44

The code block shown below contains an error. The code block intended to read a parquet at the file path filePath into a DataFrame. Identify the error.
Code block:
spark.read.load(filePath, source – "parquet")

Answer options

Correct answer: E

Explanation

The correct answer is E because the load() method does not require the source parameter; it can be omitted entirely. Options A and B are incorrect as they suggest incorrect usage of parameters or method names. Option C is wrong because the spark.read operation does not require parentheses to function properly. Option D misinterprets the need for quoting the filePath argument, which is not necessary.