CertSafari
    Databricks Certified Machine Learning Associate· Lessons

    Domain 1 · Lesson 6/48

    Create a Feature Table in Unity Catalog with SQL or FeatureEngineeringClient

    Create a feature store table in Unity Catalog

    11 min read
    2.08% of exam
    4 sources
    Published 3 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • State what makes a Unity Catalog table a feature table
    • List the runtime, client and privilege prerequisites for Feature Engineering in Unity Catalog
    • Create a feature table with a SQL PRIMARY KEY constraint or with fe.create_table
    • Populate a feature table with fe.write_table

    Key concept

    Feature table in Unity Catalog — A Delta table in Unity Catalog that has a primary key constraint. You don't register it as a separate kind of object. The primary key is what lets Databricks treat the table as a source of features.

    1.What makes a table a feature table

    With the legacy Workspace Feature Store, a feature table was something the feature store client created and tracked. Unity Catalog works differently. A feature table is a Delta table with a primary key. The Feature Store overview lists this as the second step of the standard workflow, right after you turn raw data into a Spark DataFrame of features: create a Delta table in Unity Catalog that has a primary key.

    Two rules follow. First, the primary key is required. Each feature table needs one, and Databricks keeps metadata alongside the Delta table that records which data sources built it and which notebooks and jobs wrote to it. Second, a feature table is an ordinary Unity Catalog data asset, so you address it with the usual three-level name <catalog-name>.<schema-name>.<table-name>. The examples in this lesson use ml.recommender_system.customer_features: catalog ml, schema recommender_system, table customer_features.

    There are three ways to create one: Databricks SQL, the Python FeatureEngineeringClient, or Lakeflow pipelines. This page covers the first two. Whichever you pick, the result is a Delta table with a primary key, and that table can then be updated, browsed and governed through Unity Catalog.

    Checkpoint 1 of 8· Check yourself

    Which requirement must every feature table in Unity Catalog meet?

    Sources12

    2.Prerequisites: runtime, client and privileges

    Check four things before you create anything.

    Runtime and metastore. Feature Engineering in Unity Catalog needs Databricks Runtime 13.2 or above, and the Unity Catalog metastore must use Privilege Model Version 1.0.

    Python client. The client class is FeatureEngineeringClient, from the databricks-feature-engineering package on PyPI. It comes pre-installed in Databricks Runtime 13.3 LTS ML and above. On a non-ML runtime you install it yourself with %pip install databricks-feature-engineering and then run dbutils.library.restartPython(). The client runs only on Databricks. You can install it locally for unit tests with mocks, but it can't call Feature Engineering APIs from outside Databricks.

    Catalog. Feature tables need a catalog. Creating a new one with CREATE CATALOG IF NOT EXISTS <catalog-name> requires the CREATE CATALOG privilege on the metastore. Using an existing one requires USE CATALOG on that catalog.

    Schema. Feature tables have to live in a schema. Creating one with CREATE SCHEMA IF NOT EXISTS <schema-name> requires the CREATE SCHEMA privilege on the catalog.

    Which client you use depends on where the table lives, not on the runtime version:

    Which package and client to use, by runtime and table location
    Databricks RuntimeFeature tables inPackagePython client
    14.3 ML and aboveUnity Catalogdatabricks-feature-engineeringFeatureEngineeringClient
    14.3 ML and aboveWorkspacedatabricks-feature-engineeringFeatureStoreClient
    14.2 ML and belowUnity Catalogdatabricks-feature-engineeringFeatureEngineeringClient
    14.2 ML and belowWorkspacedatabricks-feature-storeFeatureStoreClient

    Checkpoint 2 of 8· Check yourself

    A team on Databricks Runtime 14.2 ML wants to create feature tables in Unity Catalog. Which client should they instantiate?

    Checkpoint 3 of 8· Check yourself

    A user wants to put feature tables in a new schema inside an existing catalog. Which pair of privileges do they need?

    Sources23

    3.Creating a feature table with Databricks SQL

    The SQL route is a normal CREATE TABLE with two additions. The key column is declared NOT NULL, and a named CONSTRAINT ... PRIMARY KEY clause says which column or columns identify each row. Nothing marks the table as a feature table. The constraint does that on its own.

    A Unity Catalog feature table created in SQL, with customer_id as the primary keysql
    CREATE TABLE ml.recommender_system.customer_features (
      customer_id int NOT NULL,
      feat1 long,
      feat2 varchar(100),
      CONSTRAINT customer_features_pk PRIMARY KEY (customer_id)
    );

    Once the table exists you load data into it the same way as any other Delta table, and it already works as a feature table. The constraint name follows a convention: the table name without catalog and schema, plus _pk. That gives customer_features_pk here.

    Checkpoint 4 of 8· Check yourself

    After running the CREATE TABLE statement above, what else is needed before ml.recommender_system.customer_features can be used as a feature table?

    Sources2

    4.Creating a feature table with fe.create_table

    In Python you start from the features. Write a function that computes them and returns an Apache Spark DataFrame with a unique primary key, which can be a single column or several. Then instantiate FeatureEngineeringClient and call create_table. You give it the three-level name, the primary key, and the table's shape. There are two ways to supply the shape:

    - schema=customer_features_df.schema creates an empty table with the DataFrame's schema. - df=customer_features_df creates the table and also saves the features to the underlying Delta table straight away.

    The documented arguments:

    fe.create_table arguments in the Unity Catalog examples
    ArgumentExample valuePurpose
    name'ml.recommender_system.customer_features'Three-level Unity Catalog name of the table
    primary_keys'customer_id' or ['customer_id', 'date']One column, or a list for a composite key
    schemacustomer_features_df.schemaTakes the table schema from the computed DataFrame
    dfcustomer_features_dfAlternative to schema that also saves the features to the Delta table
    timeseries_columns'date'Marks a primary key column as the time series key
    description'Customer features'Text description of the table

    Checkpoint 5 of 8· Fill the gap

    Which argument declares the key that identifies each row of the feature table?

    customer_feature_table = fe.create_table(
      name='ml.recommender_system.customer_features',
       ? ='customer_id',
      schema=customer_features_df.schema,
      description='Customer features'
    )

    Checkpoint 6 of 8· Exam question

    A data scientist has an existing Delta table `retail.features.customer_orders` with columns `customer_id`, `order_count`, and `avg_order_value`. She wants Feature Engineering in Unity Catalog to treat it as a usable feature table when she calls `fe.create_training_set` later. What must be true about the table for that to work?

    Sources2

    5.Populating the table with fe.write_table

    If you created the table with schema=, it's empty. You fill it, and later refresh it, with write_table, passing the table name and a DataFrame of feature values. The documented examples use mode="merge", both in the time series write sample below and in the unit-test example for FeatureEngineeringClient.write_table.

    Writing a batch of feature values to a Unity Catalog feature table in merge modepython
    fe.write_table(
      "ml.ads_team.user_features",
      daily_users_batch_df,
      mode="merge"
    )

    Checkpoint 7 of 8· Put it in order

    Put the Python steps for building a Unity Catalog feature table in order

    1. 1.Instantiate FeatureEngineeringClient and call create_table
    2. 2.Populate the feature table using write_table
    3. 3.Write a function that computes the features as a Spark DataFrame with a unique primary key

    Checkpoint 8 of 8· Exam question

    A team is building a feature table for fraud detection where feature values change throughout the day and the training set must only use values that were known at each transaction's timestamp, to avoid leaking future information. Which approach correctly creates this table with `FeatureEngineeringClient.create_table`?

    Sources2

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.Only tables created with fe.create_table count as feature tables in Unity Catalog.Why is that wrong?

      Any Unity Catalog Delta table with a primary key constraint is a feature table, including one created in plain SQL. It appears in the Features UI automatically.

      Covered in What makes a table a feature table

    2. 2.FeatureStoreClient is the client for creating feature tables in Unity Catalog.Why is that wrong?

      FeatureStoreClient is for the legacy Workspace Feature Store. Unity Catalog feature tables use FeatureEngineeringClient on every runtime version.

      Covered in Prerequisites: runtime, client and privileges

    Sources

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Create a Delta table in Unity Catalog that has a primary key.”
      ↩︎ What makes a table a feature table
      “Each table must have a primary key, and is backed by a Delta table and additional metadata.”
      ↩︎ What makes a table a feature table
    2. 2.
      “Feature tables, like other data assets in Unity Catalog, are accessed using a three-level namespace”
      ↩︎ What makes a table a feature table
      “Feature Engineering in Unity Catalog requires Databricks Runtime 13.2 or above.”
      ↩︎ Prerequisites: runtime, client and privileges
      “If you use a non-ML Databricks Runtime, you must install the client manually.”
      ↩︎ Prerequisites: runtime, client and privileges
      “To create a new catalog, you must have the CREATE CATALOG privilege on the metastore.”
      ↩︎ Prerequisites: runtime, client and privileges
      “You can use any Delta table with a primary key constraint as a feature table.”
      ↩︎ Creating a feature table with Databricks SQL
      “By convention, you can use the table name (without schema and catalog) with a _pk suffix.”
      ↩︎ Creating a feature table with Databricks SQL
      “The output of each function should be an Apache Spark DataFrame with a unique primary key.”
      ↩︎ Creating a feature table with fe.create_table
      “This code automatically saves the features to the underlying Delta table.”
      ↩︎ Creating a feature table with fe.create_table
      “To use a composite primary key, pass all primary key columns in the create_table call”
      ↩︎ Creating a feature table with fe.create_table
      “Populate the feature table using write_table.”
      ↩︎ Populating the table with fe.write_table
      “In Unity Catalog, any Delta table with a primary key constraint can serve as a feature table.”
      ↩︎ Key concept
      “Feature tables must have a primary key.”
      ↩︎ Checkpoint
      “To create a new schema in the catalog, you must have the CREATE SCHEMA privilege on the catalog.”
      ↩︎ Checkpoint
      “After the table is created, you can write data to it like other Delta tables, and it can be used as a feature table.”
      ↩︎ Checkpoint
      “Create a feature table by instantiating a FeatureEngineeringClient and using create_table.”
      ↩︎ Checkpoint
    3. 3.
      “The client library can only be run on Databricks, including Databricks Runtime and Databricks Runtime for Machine Learning.”
      ↩︎ Prerequisites: runtime, client and privileges
      “To use Workspace Feature Store, you must use FeatureStoreClient.”
      ↩︎ Exam trap 2
      “To work with feature tables in Unity Catalog, use FeatureEngineeringClient.”
      ↩︎ Checkpoint

    Also cited

    Continue to page 2 of 2

    Time Series, Existing Delta and Lakeflow Feature Tables in Unity Catalog

    Spotted a mistake, or was something unclear? Tell us.