Databricks Certified Machine Learning Professional — Question 85
A machine learning engineer wants to load the data from the very first version of a Delta table from location path.
Which of the following lines of code can be used to accomplish this task?
Answer options
- A. spark.read.format("delta").option("version", 0).load(path)
- B. spark.read.format("delta").option("versionAsOf", 0).load(path)
- C. spark.read.format("delta").option("versionAsOf", 1).load(path)
- D. spark.read.format("delta").option("version", 1).load(path)
Correct answer: C
Explanation
The correct option is B because it uses 'option("versionAsOf", 0)' to accurately load the very first version of the Delta table. Options A and D reference the wrong version number, and option C references version 1, which is not the first version, thus they are incorrect.