CertLumen

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 install on 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; add ts TIMESERIES for 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?

  1. Afe.write_table(name="ml.churn.customer_features", df=features_df, mode="overwrite")
  2. Bfe.create_table(name="ml.churn.customer_features", primary_keys="customer_id", df=features_df)
  3. Cfe.create_table(name="customer_features", primary_keys="customer_id", schema=features_df.schema)
  4. Dfe.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

← Previous objective · All 48 objectives · Next objective →