CERTIFIED-MACHINE-LEARNING-PROFESSIONAL · Question #10
CERTIFIED-MACHINE-LEARNING-PROFESSIONAL Question #10: Real Exam Question with Answer & Explanation
Option D is correct because the Databricks Feature Store requires using the Feature Store Client API - specifically fs.create_table() (with the df parameter to populate on creation) or the combination of fs.create_table() + fs.write_table(). This is the only supported interface f
Question
A data scientist has created a Python function compute_features that returns a Spark DataFrame with the following schema: The resulting DataFrame is assigned to the features_df variable. The data scientist wants to create a Feature Store table using features_df. Which of the following code blocks can they use to create and populate the Feature Store table using the Feature Store Client fs? A. B.
Options
- Cfeatures_df.write.mode("fs").path("new_table")
- Efeatures_df.write.mode("feature").path("new_table")
Explanation
Option D is correct because the Databricks Feature Store requires using the Feature Store Client API - specifically fs.create_table() (with the df parameter to populate on creation) or the combination of fs.create_table() + fs.write_table(). This is the only supported interface for registering and writing to Feature Store tables.
Options C and E are wrong for the same fundamental reason: features_df.write.mode("fs") and features_df.write.mode("feature") are not valid Spark write modes. The standard DataFrame .write API knows nothing about Feature Store - modes like "overwrite" and "append" are valid, but "fs" and "feature" do not exist and will raise errors at runtime.
Options A and B (not shown in full) are likely wrong because they either use incorrect method names on the fs client, omit required parameters like primary_keys, or pass arguments in the wrong order - the Feature Store Client is strict about its interface.
Memory tip: Think of it this way - the Feature Store is a separate system from the raw Spark data lake, so you always go through the client (fs.create_table, fs.write_table), never around it with raw .write calls. If you see a Spark .write chained directly on a DataFrame for Feature Store, it's always wrong.
Community Discussion
No community discussion yet for this question.