Databricks Machine Learning Associate · Section 1 · 38% of the exam
Identify the benefits of creating feature store tables at the account level in Unity Catalog in Databricks vs at the workspace level
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 engineer runs INSERT INTO ml_prod.churn.customer_features VALUES ('C42', 31, 118.5). The table has a PRIMARY KEY (customer_id) constraint and already holds a row for C42, yet the insert succeeds and the table now has two rows for that customer. What explains this, and what should the feature pipeline do?
- APrimary key constraints in Unity Catalog are informational and not enforced, so the pipeline must deduplicate keys before writing
- BThe constraint was created without the
ENFORCEDoption; recreating it asPRIMARY KEY (customer_id) ENFORCEDmakes later duplicate inserts fail - CUniqueness is enforced only for SQL writes made on a SQL warehouse, so the pipeline should run its INSERT statements there
- DThe table keeps one row per key version, and the training set automatically uses only the newest row for each customer
Show the answer
A. Primary key and foreign key constraints in Unity Catalog document the key and let Feature Engineering treat the table as a feature table, but Databricks does not check them when data is written. Duplicate keys break the one-row-per-entity grain that every lookup relies on. Deduplicate before writing, and upsert with fe.write_table (merge) or MERGE INTO instead of a plain INSERT.
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
- Create a feature store table in Unity Catalog
- 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