Databricks Certified Machine Learning Professional — Question 64
A data scientist wants to examine the data in the Feature Store table table from the database dev as a Spark DataFrame. They have access to Feature Store Client fs.
Which line of code can be used to gel the data from table as a Spark DataFrame?
Answer options
- A. fs.get_table("table)
- B. fs.read_table("dev.table")
- C. fs.create_table("dev.table")
- D. fs.get_table("dev.table")
Correct answer: B
Explanation
The correct answer is B, as the method 'fs.read_table("dev.table")' is specifically designed to read a table as a Spark DataFrame. Option A is incorrect because it lacks the database prefix, while C is not applicable since it attempts to create a table instead of reading it. Option D is incorrect as 'fs.get_table' is typically used to retrieve metadata about the table, not to load it as a DataFrame.