Databricks Machine Learning Associate · Section 1 · 38% of the exam
Create a feature store table in Unity Catalog
One of the objectives of the Databricks Certified Machine Learning Associate exam, in the section “Databricks Machine Learning”. Here is what it covers, the points to remember and a question to try.
What it covers
In Unity Catalog, any Delta table with a primary key can be a feature table, governed and shared like any other table. This lesson compares it with the legacy workspace feature store, then shows how to create feature tables with Python and SQL and how to write to them with merge semantics.
Points to remember
- In Unity Catalog any Delta table with a primary key constraint is a feature table.
- Unity Catalog feature tables are reachable from every workspace on the metastore, governed by Unity Catalog privileges and audit logs, with automatic lineage and discovery; the Workspace Feature Store is deprecated.
- Client:
from databricks.feature_engineering import FeatureEngineeringClient(pre-installed on 13.3 LTS ML+;%pip installon serverless). fe.create_table(name, primary_keys, df= or schema=, timeseries_column=, partition_columns=, description=, tags=)fails if the table exists.- SQL:
CONSTRAINT pk PRIMARY KEY (id)with NOT NULL key columns; addts TIMESERIESfor time series keys.
Try a question
A data scientist has computed a Spark DataFrame features_df with one row per customer_id. Which code creates a new Unity Catalog feature table and writes the rows in one call?
- A
fe.write_table(name="ml.churn.customer_features", df=features_df, mode="overwrite") - B
fe.create_table(name="ml.churn.customer_features", primary_keys="customer_id", df=features_df) - C
fe.create_table(name="customer_features", primary_keys="customer_id", schema=features_df.schema) - D
fe.publish_table(source_table_name="ml.churn.customer_features", df=features_df)
Show the answer
B. FeatureEngineeringClient.create_table takes a three-level name, primary_keys and either df (create and write) or schema (create empty). It fails if the table exists; later updates use write_table.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Feature tables in Unity Catalog teaches this objective (about 35 minutes), and 15 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.
More in this section
- Identify the best practices of an MLOps strategy
- Identify the advantages of using ML runtimes
- Identify how AutoML facilitates model/feature selection.
- Identify the advantages AutoML brings to the model development process
- Identify the benefits of creating feature store tables at the account level in Unity Catalog in Databricks vs at the workspace level
- Write data to a feature store table
- Train a model with features from a feature store table.
- Score a model using features from a feature store table.
- Describe the differences between online and offline feature tables
- Identify the best run using the MLflow Client API.
- Manually log metrics, artifacts, and models in an MLflow Run.
- Identify information available in the MLflow UI