Skip to main content
Version: Current

Feature Store Enricher

Mode: Streaming Mode: Request-Response

Description​

The Feature Store Enricher reads the latest features of an entity, such as a customer or a merchant, from an online feature store, and puts them in a record. The first supported store is the Snowflake Online Feature Store.

Parameters​

NameDescription
Feature viewA feature view of the store, at one version, whose online table is ready.
one field per join keyThe value of each key the feature view's entity is found by, e.g. CUSTOMER_ID.
Output variable nameA record with every feature of the view. A key the store does not know gives the same record with null features.

A lookup that fails (the store is busy, a feature could not be read, the token expired, the online service was dropped) fails the event.

Snowflake Online Feature Store​

Set it up in the Integrations view of the Designer, in the Snowflake ML part of the Snowflake integration. Or put the configuration in the configuration file:

components.customer-features {
providerType: "snowflakeFeatureStore"
componentPrefix: "store-"
snowflake {
accountUrl: "https://<organization>-<account>.snowflakecomputing.com"
token: ${SNOWFLAKE_PAT}
role: "NU_APP"
}
featureStoreSchema: "MY_DB.FEATURES"
}

The component is named <componentPrefix>features: store-features in the example above. Two optional blocks tune it: cache { listFeatureViews: "30 seconds", describe: "60 minutes" }, how long the Designer keeps the list of feature views and their definitions (these are the defaults), and httpClient, the HTTP client of the online lookups, as in the other HTTP components. The lookups call the online service's Query API.

The feature views need the Postgres online store (OnlineConfig(enable=True, store_type=OnlineStoreType.POSTGRES)) and a running online service, which needs a paid Snowflake account.

The token is a programmatic access token. Its user must be under a network policy that allows both the Designer and the Nussknacker runtime: both call Snowflake, the runtime also when a scenario starts. Its role must be the online service's consumer role (create_online_service(..., consumer_role=...)) and needs USAGE on the database and the feature store schema, and SELECT and MONITOR on the online feature tables and on the dynamic tables of the feature views.

The features can have these Snowflake types: NUMBER, FLOAT, VARCHAR, BOOLEAN, TIMESTAMP_NTZ, TIMESTAMP_LTZ and TIMESTAMP_TZ. A feature view with a column of another type, for example DATE or VARIANT, cannot be used yet. A NUMBER with scale 0 and a precision up to 18 is a Long; any other NUMBER, including INTEGER (NUMBER(38,0)), is a BigDecimal.