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.
| Feature store object | Snowflake object |
|---|---|
| feature store | schema |
| feature view | dynamic table or view |
| entity | tag |
| feature | column 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.
Every Feature Store object maps to an existing Snowflake object. That is why role-based access control applies to it and why changes made in SQL show up in the Python API. An entity is only a tag that carries its join keys. It is not a table of its own.
“feature store | schema feature view | dynamic table or view entity | tag feature | column in a dynamic table or in a view”Source: docs.snowflake.com
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.
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.
| Aspect | Snowflake-managed | External |
|---|---|---|
| refresh_freq | A time delta or cron expression | None |
| Feature table | Dynamic table refreshed by Snowflake | Table you build and maintain, e.g. with dbt |
| Feature DataFrame | Transformation logic over the raw source | Usually a simple projection of the feature table |
| Storage | Dynamic table holds the features | View 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?
Snowflake has to run the transformation, so the view must be managed. Incremental refresh needs change tracking, and Snowflake can only turn that on if you own the table. Without ownership, the options are to ask the owner to enable it or to use refresh_mode='FULL'. An external view would leave keeping the feature table current to the team.
“If you do not own the table, ask the owner to enable change tracking, or create the feature view with refresh_mode='FULL'”Source: docs.snowflake.com
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.
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.
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?
update_feature_view can change only the refresh frequency, the warehouse and the description. Once a view is registered, its pipeline definition is immutable, so a changed window or a new column needs a new version. Consumers of V1 see no change.
“Feature definitions and columns cannot be modified. To change the features in a feature store, create a new version of the feature view.”Source: docs.snowflake.com
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.
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,
)feature_granularity sets the tile size. The Feature Store keeps a partial aggregate for each tile, refreshes the tiles on the refresh_freq schedule and stitches them into the trailing windows at query time. offset moves a window into the past, and each window's length is given inside the Feature call, such as "7d".
Source: docs.snowflake.comSources5
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".
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.
There is one registered, immutable definition. Training reads its historical values through the ASOF join, and inference reads its latest values. Both come from the same computation, so the feature cannot differ between the two.
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",
)spine_timestamp_col makes the join point-in-time. For each spine row, the join takes the latest feature value at or before that timestamp. timestamp_col belongs to the FeatureView constructor, and spine_label_cols only marks which columns are labels. Because these views include a tiled one, join_method="cte" is also required.
Source: docs.snowflake.comCheckpoint 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)
Correct answers: A, D — Retrain new models against V2 and keep V1 active until every model that depends on it has been retired or migrated.; Register the new definition under the same feature view name with version="V2", leaving the existing version untouched.
- A. Consumers pin to a version, so keeping V1 available protects running models while migration proceeds at its own pace.
- B. Overwriting replaces the definition behind existing models, silently changing their inputs and causing skew relative to training.
- C. Feature view objects are managed by the Feature Store, and manual edits bypass its version metadata.
- D. Feature view versions are immutable, and a new version under the same name lets both windows coexist.
- E. Multiple versions per feature view name are supported, and dropping V1 would break the models that read it.
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?
Correct answer: C — generate_dataset, which materializes the joined features and labels into a versioned Snowflake Dataset that can be reloaded by name.
- A. It is meant for inference lookups against current values and does not create a named, versioned object.
- B. That method returns a query-backed DataFrame rather than a stored snapshot, so results can change when the underlying features refresh.
- C. generate_dataset writes a Dataset object with versions that do not change, supporting reproducibility and lineage for training runs.
- D. Reading a feature view shows only the latest feature state with no labels, no join with a spine and no frozen version.
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)
Correct answers: B, C — Define a FeatureView from a Snowpark DataFrame with refresh_freq="1 hour" and call register_feature_view with a version string.; Register an Entity named CUSTOMER with join_keys=["CUSTOMER_ID"] so features can be looked up and joined by that key.
- A. Parquet exports sit outside the Feature Store, so no entity, versioning or discoverable lineage is registered for sharing.
- B. A feature view with a refresh frequency is materialized and kept current by Snowflake, so no external scheduler is needed.
- C. An Entity declares the business object and its join keys, which feature views and later retrieval use to join features to a spine.
- D. Datasets are produced from existing feature views, so they are a later step and not a prerequisite for registering one.
- E. Hand-written task code is exactly what managed feature views replace; it is not required and bypasses feature view versioning.
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.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.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.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.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.
“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.
“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.https://www.snowflake.com/en/developers/guides/intro-to-online-feature-store-in-snowflakeSecondary source
“refresh_freq: How often to refresh the offline feature table (Dynamic Table)”
↩︎ Managed and external feature views - 4.https://www.snowflake.com/en/developers/guides/advanced-guide-to-snowflake-feature-storeSecondary source
“from that point forward incrementally maintained when new data lands in the source tables”
↩︎ Managed and external feature views - 5.https://docs.snowflake.com/en/developer-guide/snowflake-ml/feature-store/advanced-feature-engineeringOfficial docs
“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