CertSafari
    Snowflake SnowPro Advanced: Data Scientist (DSA-C03)· Lessons

    Domain 2 · Lesson 7/16

    Snowflake Feature Store: entities, feature views and point-in-time training sets

    Perform feature engineering on Snowflake data.

    15 min read
    6.75% of exam
    5 sources
    Published 20 Oct 2026
    Docs as of 4 Oct 2026

    What you will be able to do

    • Map Feature Store objects (feature store, entity, feature view, feature) to the Snowflake objects that implement them
    • Decide between a Snowflake-managed and an external feature view, and set refresh_freq accordingly
    • Register, retrieve, update and version a feature view without breaking existing consumers
    • Define time-windowed aggregate features and generate a point-in-time correct training set from a label spine

    1.Feature stores, entities and join keys

    A feature store keeps feature definitions in one place, so every training job and every inference call computes AVG_SPEND_30D the same way and nobody re-implements it in a private notebook. The Snowflake Feature Store holds those definitions, keeps the values fresh from source data, and never moves the data out of Snowflake.

    It is built entirely from ordinary Snowflake objects. A feature store is just a schema, either a new one or an existing one. Because of that, role-based access control applies to it, and changes you make in SQL show up in the Python API (snowflake-ml-python) and the other way round.

    How Feature Store objects are implemented in Snowflake
    Feature store objectSnowflake object
    feature storeschema
    feature viewdynamic table or view
    entitytag
    featurecolumn in a dynamic table or in a view

    An entity is the subject a feature describes. In a movie-streaming store, users and movies are the entities. It is declared with its join keys, for example Entity(name="user", keys=["USER_ID"]). Every feature view tagged with that entity must carry the join key columns in its DataFrame, and that requirement is what lets features from different views be joined onto the same training row.

    Checkpoint 1 of 8· Match them up

    The Snowflake Feature Store is built from ordinary Snowflake objects. Match each Feature Store object to the Snowflake object that implements it.

    Tap a term, then the definition that fits it.

    Sources12

    2.Managed and external feature views

    A feature view wraps a Python or SQL pipeline that turns raw data into one or more related features. All features in one view refresh together. The FeatureView constructor takes a Snowpark DataFrame holding the transformation logic, plus a timestamp_col when the features are time series. One parameter, refresh_freq, decides who keeps the view up to date.

    A Snowflake-managed feature view: setting refresh_freq is what makes it managedpython
    managed_fv = FeatureView(
        name="MY_MANAGED_FV",
        entities=[entity],
        feature_df=my_df,                   # Snowpark DataFrame containing feature transformations
        timestamp_col="ts",                 # optional timestamp column name in the dataframe
        refresh_freq="5 minutes",           # how often feature data refreshes
        desc="my managed feature view"      # optional description
    )

    A managed view is stored as a dynamic table, and refresh_freq sets how often that table refreshes. It takes a time delta of at least 1 minute or a cron expression with a time zone. Incremental refresh means the table is maintained as new data lands in the source tables, instead of re-reading the whole source each time. It depends on change tracking, a setting that must be enabled on every source table. Snowflake tries to enable it, which requires OWNERSHIP of the table. If you don't own it, refresh_mode='FULL' re-reads the whole source on every refresh. A query that Snowflake cannot maintain incrementally also falls back to full refreshes, which add lag and cost.

    Managed against external feature views
    AspectSnowflake-managedExternal
    refresh_freqA time delta or cron expressionNone
    Feature tableDynamic table refreshed by SnowflakeTable you build and maintain, e.g. with dbt
    Feature DataFrameTransformation logic over the raw sourceUsually a simple projection of the feature table
    StorageDynamic table holds the featuresView on your table; no additional storage cost

    Use an external view when another pipeline already computes the features, or for slow-changing attributes such as account tier or signup channel. When you want Snowflake to run the transformation itself, use a managed view.

    Checkpoint 2 of 8· Check yourself

    A team wants Snowflake to compute a 30-day spend feature from a raw events table every hour. The team doesn't own that table, and change tracking is not enabled on it. Which setup gives them a working feature view?

    Sources1234

    3.Registering, versioning and updating feature views

    Every call below goes through a FeatureStore object, the Python handle on the schema that holds your feature store. It is created from a Snowpark session, the database and schema of the store, and a default warehouse for the work Snowflake runs on your behalf. The session comes from the same Session.builder setup used for any Snowflake ML work.

    Creating the FeatureStore handle used as fs throughout this pagepython
    fs = FeatureStore(session, db, schema, default_warehouse=warehouse)

    A feature view is not live until it is registered with a name and a version. Registration starts the automatic refresh, and block=True waits until the initial data is available. After registration, the pipeline definition is immutable, so every consumer of version 1 gets the same computation for as long as that version exists.

    Registering a feature view under an explicit versionpython
    registered_fv: FeatureView = fs.register_feature_view(
        feature_view=managed_fv,    # feature view created above, could also use external_fv
        version="1",
        block=True,         # whether function call blocks until initial data is available
        overwrite=False,    # whether to replace existing feature view with same name/version
    )

    Retrieve a view later with fs.get_feature_view(name=..., version=...), list views (optionally filtered by entity) with fs.list_feature_views, and attach per-feature descriptions with attach_feature_desc so the features turn up in Snowsight search. update_feature_view changes exactly three properties: the refresh frequency, the warehouse that runs the transforms, and the description.

    Changing what a feature computes is a different operation. Turning a 30-day spend window into a 60-day one changes the feature definition, and definitions and columns cannot be modified. Register the new logic as a new version, such as 'V2', and move models to it when they are ready. Consumers of 'V1' see no change.

    Checkpoint 3 of 8· Check yourself

    Your churn model reads AVG_SPEND_30D from the registered feature view CUSTOMER_SPEND, version V1. The analysts now want that window to be 60 days. Which way of making the change is supported?

    Sources52

    4.Time-windowed aggregate features

    Trailing-window aggregates such as spend over 7 days or orders over 30 days are among the most common derived features, and recomputing them from raw events every time is expensive. The Aggregations API (snowflake-ml-python 1.24.0 or later) declares them with Feature.sum, min, max, count, avg, approx_count_distinct and last_distinct_n, each over a window.

    An entity, four windowed aggregate features, and a tiled feature viewpython
    from snowflake.ml.feature_store import Entity, Feature, FeatureView
    
    user = Entity(name="user", keys=["USER_ID"])
    
    features = [
        Feature.sum("AMOUNT", "7d").alias("TOTAL_SPEND_7D"),
        Feature.count("EVENT_ID", "30d").alias("EVENT_COUNT_30D"),
        Feature.avg("AMOUNT", "24h").alias("AVG_AMOUNT_24H"),
        Feature.last_distinct_n("PRODUCT_ID", "7d", n=10).alias("RECENT_PRODUCTS_7D"),
    ]
    
    fv = FeatureView(
        name="USER_BEHAVIOR_WINDOWED",
        entities=[user],
        feature_df=session.table("RAW_EVENTS"),
        timestamp_col="EVENT_TS",
        feature_granularity="1h",
        refresh_freq="1h",
        features=features,
    )

    feature_granularity sets the tile size. The Feature Store keeps partial aggregates per tile, refreshes them on the refresh_freq schedule, and stitches them together at query time into the 7-day or 30-day windows. If you pass both feature_df and features, the DataFrame runs first, with its joins, filters and derived columns, and the aggregations are computed on its output. offset shifts a window into the past, so Feature.sum("AMOUNT", "7d", offset="7d") gives the previous week for a week-over-week comparison. The offset must be a multiple of feature_granularity.

    Checkpoint 4 of 8· Fill the gap

    This tiled feature view keeps hourly partial aggregates and stitches them into 7-day and 30-day windows at query time. Which parameter sets the size of those tiles?

    from snowflake.ml.feature_store import Entity, Feature, FeatureView
    
    user = Entity(name="user", keys=["USER_ID"])
    
    features = [
        Feature.sum("AMOUNT", "7d").alias("TOTAL_SPEND_7D"),
        Feature.count("EVENT_ID", "30d").alias("EVENT_COUNT_30D"),
        Feature.avg("AMOUNT", "24h").alias("AVG_AMOUNT_24H"),
        Feature.last_distinct_n("PRODUCT_ID", "7d", n=10).alias("RECENT_PRODUCTS_7D"),
    ]
    
    fv = FeatureView(
        name="USER_BEHAVIOR_WINDOWED",
        entities=[user],
        feature_df=session.table("RAW_EVENTS"),
        timestamp_col="EVENT_TS",
         ? ="1h",
        refresh_freq="1h",
        features=features,
    )

    Sources5

    5.Point-in-time correct training sets

    A training row must not include feature values from after its label was observed. Suppose a churn label is dated 1 March, but the join pulls the customer's current AVG_SPEND_30D, which includes April's collapse in spending. The model learns from information it will never have at inference time. It scores well offline and then fails in production.

    The Feature Store prevents this with an ASOF join against a spine. The spine is a DataFrame of entity keys, a timestamp and labels, for example CUSTOMER_ID, LABEL_TS and CHURNED. For each spine row, the join takes the most recent feature value for that entity at or before the spine timestamp. Passing spine_timestamp_col is what makes the join point-in-time, and spine_label_cols marks which columns are labels and not features. Tiled feature views also require join_method="cte".

    Generating a point-in-time correct training set from a spine and two registered feature viewspython
    training_df = fs.generate_training_set(
        spine_df=spine_df,
        features=[registered_purchase_fv, registered_agg_fv],
        spine_timestamp_col="SESSION_START_TS",
        spine_label_cols=["LABEL"],
        join_method="cte",
    )

    generate_training_set returns a DataFrame for immediate use. To keep the same point-in-time correct rows for later runs, generate_dataset saves them as a named, versioned Snowflake ML Dataset, as described in Freezing training data (Snowflake ML Datasets). Training then reads a snapshot that does not change when the feature views refresh.

    Checkpoint 5 of 8· Fill the gap

    A churn spine holds each customer's key, the time their label was observed and the label itself. To stop rows from picking up feature values recorded after that time, the ASOF join needs to know which spine column holds the label time. Complete the call.

    training_df = fs.generate_training_set(
        spine_df=spine_df,
        features=[registered_purchase_fv, registered_agg_fv],
         ? ="SESSION_START_TS",
        spine_label_cols=["LABEL"],
        join_method="cte",
    )

    Checkpoint 6 of 8· Exam question

    The AVG_SPEND_30D feature view is version 'V1' and feeds production models. The team wants a 60-day window variant without disturbing existing consumers. Select TWO appropriate actions.(Select 2)

    0 of 2 selected

    Checkpoint 7 of 8· Exam question

    A data science lead wants a reproducible, immutable, versioned snapshot of training data built from Feature Store features and a label spine, which can be referenced by name in later model runs. Which Feature Store method provides this?

    Checkpoint 8 of 8· Exam question

    A team wants an AVG_SPEND_30D feature per customer, refreshed every hour from a raw orders table, shared across projects without writing scheduler code. Select TWO steps in the Snowflake Feature Store that deliver this.(Select 2)

    0 of 2 selected

    Sources51

    Practise it for real

    Build an hourly, versioned windowed-spend feature for users and use it to generate a point-in-time correct training set.

    1. 1.Declare the entity with Entity(name="user", keys=["USER_ID"]).

      Why: The entity's join keys are how feature values attach to spine rows.

      You should see: An Entity object, implemented in Snowflake as a tag once registered.

    2. 2.Define features with Feature.sum("AMOUNT", "7d") and Feature.avg("AMOUNT", "24h"), then a FeatureView over RAW_EVENTS with timestamp_col="EVENT_TS", feature_granularity="1h" and refresh_freq="1h".

      Why: Setting refresh_freq makes the view Snowflake-managed, and feature_granularity sets the tile size.

      You should see: A FeatureView definition. Nothing is stored yet.

    3. 3.Call fs.register_feature_view(feature_view=fv, version="1", block=True).

      Why: Registration makes the definition immutable and starts the scheduled refresh.

      You should see: The call returns once initial data is available, and the view appears in fs.list_feature_views().

    4. 4.Call fs.generate_training_set with your spine_df, spine_timestamp_col set to the label timestamp, spine_label_cols set to the label column, and join_method="cte".

      Why: The spine timestamp drives the ASOF join, and tiled views require the cte join method.

      You should see: A DataFrame with one row per spine row, holding feature values as of each row's timestamp.

    Stuck? Get a nudge

    If registration warns about change tracking on RAW_EVENTS, either ask the table owner to enable it or add refresh_mode='FULL'.

    Sources

    (5)

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

    1. 1.
      “A feature store in Snowflake is simply a schema.”
      ↩︎ Feature stores, entities and join keys
      “An entity is a higher-level abstraction that represents the subject matter of a feature.”
      ↩︎ Feature stores, entities and join keys
      “Changes you make via SQL are reflected in the Python API and vice versa.”
      ↩︎ Feature stores, entities and join keys
      “All features defined in a feature view are refreshed from the source data at the same time.”
      ↩︎ Managed and external feature views
      “Backfill and point-in-time correct features with ASOF JOIN”
      ↩︎ Point-in-time correct training sets
      “feature store | schema feature view | dynamic table or view entity | tag feature | column in a dynamic table or in a view”
      ↩︎ Checkpoint
    2. 2.
      “The provided DataFrame must also contain the join_keys columns specified in the entities associated with the feature view.”
      ↩︎ Feature stores, entities and join keys
      “A Snowflake-managed feature view uses a dynamic table as the feature table.”
      ↩︎ Managed and external feature views
      “To qualify for incremental refresh, each source table must have change tracking enabled.”
      ↩︎ Managed and external feature views
      “The value can be a time delta (minimum value 1 minute), or it can be a cron expression with time zone”
      ↩︎ Managed and external feature views
      “create the feature view with refresh_mode='FULL', which fully reads the source table for each refresh.”
      ↩︎ Managed and external feature views
      “External feature views are implemented as views on your feature table, so they incur no additional storage cost.”
      ↩︎ Managed and external feature views
      “the table will be fully refreshed from the query at the specified frequency”
      ↩︎ Managed and external feature views
      “A feature view pipeline definition is immutable after it has been registered”
      ↩︎ Registering, versioning and updating feature views
      “Feature definitions and columns cannot be modified. To change the features in a feature store, create a new version of the feature view.”
      ↩︎ Registering, versioning and updating feature views
      “You are responsible for maintaining the feature table, updating features from raw data as needed”
      ↩︎ Exam trap 1
      “Feature definitions and columns cannot be modified. To change the features in a feature store, create a new version of the feature view.”
      ↩︎ Exam trap 2
      “A feature view is considered Snowflake-managed if you provide a schedule for refreshing it.”
      ↩︎ Prediction
      “If you do not own the table, ask the owner to enable change tracking, or create the feature view with refresh_mode='FULL'”
      ↩︎ Checkpoint
    3. 3.
      “refresh_freq: How often to refresh the offline feature table (Dynamic Table)”
      ↩︎ Managed and external feature views
    4. 4.
      “from that point forward incrementally maintained when new data lands in the source tables”
      ↩︎ Managed and external feature views
    5. 5.
      “fs = FeatureStore(session, db, schema, default_warehouse=warehouse)”
      ↩︎ Registering, versioning and updating feature views
      “These intermediate results are refreshed on the refresh_freq schedule, then stitched together at query time”
      ↩︎ Time-windowed aggregate features
      “The offset must be a multiple of feature_granularity so the shifted window aligns cleanly to tile boundaries.”
      ↩︎ Time-windowed aggregate features
      “the feature_df transformation runs first to define and prepare the base dataset, including any joins, filters, or derived columns.”
      ↩︎ Time-windowed aggregate features
      “selects the most recent snapshot row for each entity key at or before the spine timestamp”
      ↩︎ Point-in-time correct training sets
      “so each training row only uses data that would have been available as of the label or event timestamp”
      ↩︎ Point-in-time correct training sets
      “you must pass join_method="cte" to generate_training_set”
      ↩︎ Exam trap 3

    Ready to test yourself?

    Practise the 24 questions on this subdomain.

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