Databricks ML Associate Practice Question 13: UC Feature Table Primary Key
Databricks Certified Machine Learning Associate · Test 2 · question 3 of 10
A data scientist has a Spark DataFrame of per-customer aggregates keyed by customer_id and wants to publish it as a feature table in Unity Catalog with FeatureEngineeringClient.create_table(), so other teams can use it in FeatureLookup.
What must be true of the table for this to succeed?
Show answer and explanation
Answer:
A Unity Catalog feature table is an ordinary Delta table with a primary key constraint, and that constraint is what makes it a feature table. The primary key is the lookup key a FeatureLookup joins on, so it is mandatory, and Delta requires every primary key column to be NOT NULL before the constraint can be added. create_table() applies both when you pass primary_keys; when converting a table that already exists, you run ALTER TABLE ... ALTER COLUMN <col> SET NOT NULL first and then add the constraint.
Option B confuses physical layout with the constraint. Partitioning is a performance choice and is independent of whether a table qualifies as a feature table.
Option C describes the retired Workspace Feature Store path. Unity Catalog feature tables are created directly in a catalog.schema.table namespace, and the hive_metastore detour is not part of the process.
Option D applies only to time series feature tables, where a timestamp key enables point-in-time lookups. A table of current per-customer aggregates needs no such column, and the name ts is never required.
Reference: Feature engineering in Unity Catalog