Databricks Machine Learning Associate Question 80
Select 2You are working on a machine learning project in Databricks and want to save the processed feature data into the Databricks Feature Store. Which of the following steps are required to successfully write the data to a feature store table?
- A
Use the
FeatureStoreClient.create_feature_tablemethod to define and write the feature table. - B
Ensure the DataFrame to be written has a primary key column and timestamp column if required.
- C
Register the feature store table to a catalog in Databricks.
- D
Use the
FeatureStoreClient.write_tablemethod to write the DataFrame to the feature store table. - E
Save the feature store table as a Delta table using the
write.format('delta')method.
Show answer and explanation
Correct answers: B, D
Explanation
Writing data to a feature store table in Databricks involves ensuring that the DataFrame contains the necessary schema (primary key and optional timestamp) and then using the FeatureStoreClient.write_table method to save the features to the table. Other steps, like defining or registering the table, are related but not part of the data writing process itself.
- A. Incorrect.
Incorrect. The
FeatureStoreClient.create_feature_tablemethod defines the feature table, but it does not perform the action of writing data into the table. Writing the data requires a separate step. - B. Correct.
Correct. The DataFrame must include a primary key column and optionally a timestamp column, depending on the use case, as these are required for proper indexing in the feature store.
- C. Incorrect.
Incorrect. Registering a feature store table in a catalog is not a mandatory step for writing data to the feature store. It is primarily for organizational purposes and access control.
- D. Correct.
Correct. The
FeatureStoreClient.write_tablemethod is explicitly used to write feature data to an existing feature store table in Databricks. - E. Incorrect.
Incorrect. The Feature Store does not rely on directly saving Delta tables with
write.format('delta'). Instead, it uses the specializedFeatureStoreClientmethods for feature-specific operations.