Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Databricks · Databricks Machine Learning Associate

Feature tables in Unity Catalog

Databricks Machine Learning Associate · Lesson 2 of 19 · 10:31

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Databricks Certified Machine Learning Associate exam. In this lesson: what a feature table is, why feature tables live in Unity Catalog (governance, lineage, discovery, and sharing across workspaces), creating a feature table with a primary key, and writing to it with the Feature Engineering client. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Four versions of one feature

Juniper Rides computes the same rider features, like the rides of the last thirty days and the average trip length, in four different notebooks, and the numbers never quite match. The team wants one governed copy of each feature, shared by every model and every workspace. This lesson covers feature tables in Unity Catalog: why they live there, how to create them, and how to write to them.

What a feature table is

A feature store is a central place to find and share the features that models use, so that the same code computes a feature for training and for inference. In Unity Catalog, any Delta table with a primary key constraint can serve as a feature table. The primary key identifies each entity, like a rider or a station, and it can span several columns, such as a station and a date. Databricks also offers Feature Views, which you define declaratively while Databricks computes them, and recommends them for new use cases. This lesson focuses on feature tables, which you fill with your own code.

Why Unity Catalog

The older Workspace Feature Store kept feature tables inside one workspace, and it is now deprecated. Feature tables in Unity Catalog are stored at the account level, in a metastore, so every workspace attached to that metastore can use them, and OpenSharing can share them further. Unity Catalog brings governance: privileges decide who can read or change each table, and access is audited. It also tracks lineage, from the data sources, notebooks, and jobs that wrote a table, to the models and endpoints that use its features. And the Features page lets teams search and discover existing features across workspaces, instead of rebuilding them.

Creating a table

You need a catalog and a schema, with privileges to use them, and the table gets a three level name: catalog, schema, and table. In SQL, CREATE TABLE declares the columns, with key columns that are NOT NULL and a primary key constraint, and the time series keyword on a time column of the key enables point in time lookups. In Python, the FeatureEngineeringClient, pre-installed in the ML runtime, creates the table with create_table, from a name, the primary keys, and a schema or a DataFrame. An existing Delta table without a key becomes a feature table with ALTER TABLE, which adds the constraint. And drop_table deletes a feature table that is no longer needed.

Writing to a table

To fill or refresh a feature table, compute the features as a Spark DataFrame with one row per primary key, and call write_table. Its merge mode refreshes the rows whose key already exists and adds the new ones, so the other rows stay as they are. write_table also accepts a streaming DataFrame, to keep features fresh as events arrive. Because a feature table is a Delta table, you can also write to it like any other Delta table, for example with MERGE INTO in SQL. And to keep the values current, schedule the notebook that computes and writes the features as a Lakeflow job.

Recap

Let's recap. In Unity Catalog, any Delta table with a primary key constraint is a feature table, and the key can span several columns. Unity Catalog replaces the deprecated Workspace Feature Store, with tables shared across workspaces, governed by privileges, traced by lineage, and easy to discover. You create a table in SQL with a primary key, or with create_table from the FeatureEngineeringClient, and ALTER TABLE adds a key to an existing table. A time series column in the key enables point in time lookups. And write_table in merge mode refreshes existing keys and adds new ones, from a batch or a streaming DataFrame.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. A data engineer wants an existing Delta table of station features in Unity Catalog to work as a feature table, but the Features page does not list it. What is most likely missing?

    • An online store for the table
    • A primary key constraint on the table
    • A registration in the Workspace Feature Store
    • A partition on the station column
    Show the answer

    A primary key constraint on the table

    In Unity Catalog, a Delta table works as a feature table once it has a primary key constraint. “An online store for the table” would publish features for real time serving, and is not needed for the table itself. “A registration in the Workspace Feature Store” would use the legacy feature store, which is deprecated in favor of Unity Catalog. And “A partition on the station column” would only change how the files are laid out.

  2. A data scientist computes station features every day, and wants to keep the values of each day, so that training can look up the features as of the date of each ride. How should the primary key be defined?

    • The station ID alone, overwritten each day
    • A random ID generated for each row
    • The date alone, one row per day
    • Station ID and date, the date as time series
    Show the answer

    Station ID and date, the date as time series

    The station and the date together identify each daily row, and marking the date as the time series column enables point in time lookups. “The station ID alone, overwritten each day” would overwrite yesterday's values, so the history would be lost. “A random ID generated for each row” would give each row a key that no ride can ever look up. And “The date alone, one row per day” would allow only one row per day, for all the stations together.

  3. A nightly job recomputes the features of the riders who rode that day, about 2% of all riders, and must update the rider feature table, while every other rider keeps the current values. Which call fits?

    • write_table with mode set to merge
    • create_table with the new DataFrame
    • drop_table, then create_table with today’s rows
    • read_table on the feature table
    Show the answer

    write_table with mode set to merge

    Merge mode refreshes the riders whose key already exists, adds new riders, and leaves every other row as it is. “create_table with the new DataFrame” would fail, since the table already exists. “drop_table, then create_table with today’s rows” would delete the table first, and keep only the riders of the day. And “read_table on the feature table” would only read the table, and change nothing.