Skip to content

Commit 2ef71fc

Browse files
feat: Add Snowflake online store (again) (#2922)
* feat: Add snowflake online store Signed-off-by: Miles Adkins <[email protected]> * lint/format Signed-off-by: Miles Adkins <[email protected]> * removing missing testing env variables Signed-off-by: Miles Adkins <[email protected]> * test offline store first Signed-off-by: Miles Adkins <[email protected]> * snowflake online test fixes Signed-off-by: Miles Adkins <[email protected]> * format Signed-off-by: Miles Adkins <[email protected]> * fix snowflake testing (#2903) Signed-off-by: Miles Adkins <[email protected]> * change to transient table Signed-off-by: Miles Adkins <[email protected]> * remove extra lines Signed-off-by: Miles Adkins <[email protected]> * docs + nits Signed-off-by: Miles Adkins <[email protected]> * docs + nits2 Signed-off-by: Miles Adkins <[email protected]> * final docs + nits Signed-off-by: Miles Adkins <[email protected]> * Update sdk/python/feast/infra/online_stores/snowflake.py Co-authored-by: Achal Shah <[email protected]> Signed-off-by: Miles Adkins <[email protected]> * Update sdk/python/feast/infra/online_stores/snowflake.py Co-authored-by: Achal Shah <[email protected]> Signed-off-by: Miles Adkins <[email protected]> * Update sdk/python/feast/infra/online_stores/snowflake.py Co-authored-by: Achal Shah <[email protected]> Signed-off-by: Miles Adkins <[email protected]> * Update sdk/python/feast/infra/online_stores/snowflake.py Co-authored-by: Achal Shah <[email protected]> Signed-off-by: Miles Adkins <[email protected]> * fix serialization Signed-off-by: Miles Adkins <[email protected]> * fix serialization2 Signed-off-by: Miles Adkins <[email protected]> Co-authored-by: Achal Shah <[email protected]>
1 parent 61a194c commit 2ef71fc

File tree

15 files changed

+542
-37
lines changed

15 files changed

+542
-37
lines changed

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
* [PostgreSQL (contrib)](reference/offline-stores/postgres.md)
8080
* [Online stores](reference/online-stores/README.md)
8181
* [SQLite](reference/online-stores/sqlite.md)
82+
* [Snowflake](reference/online-stores/snowflake.md)
8283
* [Redis](reference/online-stores/redis.md)
8384
* [Datastore](reference/online-stores/datastore.md)
8485
* [DynamoDB](reference/online-stores/dynamodb.md)

docs/reference/offline-stores/snowflake.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Description
44

5-
The Snowflake offline store provides support for reading [SnowflakeSources](../data-sources/snowflake.md).
5+
The [Snowflake](https://trial.snowflake.com) offline store provides support for reading [SnowflakeSources](../data-sources/snowflake.md).
66

77
* Snowflake tables and views are allowed as sources.
88
* All joins happen within Snowflake.
@@ -11,7 +11,7 @@ The Snowflake offline store provides support for reading [SnowflakeSources](../d
1111
* This allows you to call
1212
* `to_snowflake` to save the dataset into Snowflake
1313
* `to_sql` to get the SQL query that would execute on `to_df`
14-
* `to_arrow_chunks` to get the result in batches ([Snowflake python connector docs](https://docs.snowflake.com/en/user-guide/python-connector-api.html#get_result_batches))
14+
* `to_arrow_chunks` to get the result in batches ([Snowflake python connector docs](https://docs.snowflake.com/en/user-guide/python-connector-api.html#get_result_batches))
1515

1616
## Example
1717

docs/reference/online-stores/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Please see [Online Store](../../getting-started/architecture-and-components/onli
44

55
{% page-ref page="sqlite.md" %}
66

7+
{% page-ref page="snowflake.md" %}
8+
79
{% page-ref page="redis.md" %}
810

911
{% page-ref page="datastore.md" %}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Snowflake
2+
3+
## Description
4+
5+
The [Snowflake](https://trial.snowflake.com) online store provides support for materializing feature values into a Snowflake Transient Table for serving online features.
6+
7+
* Only the latest feature values are persisted
8+
9+
The data model for using a Snowflake Transient Table as an online store follows a tall format (one row per feature)):
10+
* "entity_feature_key" (BINARY) -- unique key used when reading specific feature_view x entity combination
11+
* "entity_key" (BINARY) -- repeated key currently unused for reading entity_combination
12+
* "feature_name" (VARCHAR)
13+
* "value" (BINARY)
14+
* "event_ts" (TIMESTAMP)
15+
* "created_ts" (TIMESTAMP)
16+
17+
(This model may be subject to change when Snowflake Hybrid Tables are released)
18+
19+
## Example
20+
21+
{% code title="feature_store.yaml" %}
22+
```yaml
23+
project: my_feature_repo
24+
registry: data/registry.db
25+
provider: local
26+
online_store:
27+
type: snowflake.online
28+
account: SNOWFLAKE_DEPLOYMENT_URL
29+
user: SNOWFLAKE_USER
30+
password: SNOWFLAKE_PASSWORD
31+
role: SNOWFLAKE_ROLE
32+
warehouse: SNOWFLAKE_WAREHOUSE
33+
database: SNOWFLAKE_DATABASE
34+
```
35+
{% endcode %}

docs/roadmap.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ The list below contains the functionality that contributors are planning to deve
2727
* [x] [In-memory / Pandas](https://docs.feast.dev/reference/offline-stores/file)
2828
* [x] [Custom offline store support](https://docs.feast.dev/how-to-guides/adding-a-new-offline-store)
2929
* **Online Stores**
30+
* [x] [Snowflake](https://docs.feast.dev/reference/online-stores/snowflake)
3031
* [x] [DynamoDB](https://docs.feast.dev/reference/online-stores/dynamodb)
3132
* [x] [Redis](https://docs.feast.dev/reference/online-stores/redis)
3233
* [x] [Datastore](https://docs.feast.dev/reference/online-stores/datastore)
@@ -59,4 +60,4 @@ The list below contains the functionality that contributors are planning to deve
5960
* [x] Model-centric feature tracking (feature services)
6061
* [x] Amundsen integration (see [Feast extractor](https://github.com/amundsen-io/amundsen/blob/main/databuilder/databuilder/extractor/feast_extractor.py))
6162
* [x] DataHub integration (see [DataHub Feast docs](https://datahubproject.io/docs/generated/ingestion/sources/feast/))
62-
* [x] Feast Web UI (Alpha release. See [docs](https://docs.feast.dev/reference/alpha-web-ui))
63+
* [x] Feast Web UI (Alpha release. See [docs](https://docs.feast.dev/reference/alpha-web-ui))

docs/tutorials/driver-stats-on-snowflake.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: >-
3-
Initial demonstration of Snowflake as an offline store with Feast, using the Snowflake demo template.
3+
Initial demonstration of Snowflake as an offline+online store with Feast, using the Snowflake demo template.
44
---
55

66
# Drivers stats on Snowflake
@@ -61,6 +61,14 @@ offline_store:
6161
role: ROLE_NAME #case sensitive
6262
warehouse: WAREHOUSE_NAME #case sensitive
6363
database: DATABASE_NAME #case cap sensitive
64+
online_store:
65+
type: snowflake.online
66+
account: SNOWFLAKE_DEPLOYMENT_URL #drop .snowflakecomputing.com
67+
user: USERNAME
68+
password: PASSWORD
69+
role: ROLE_NAME #case sensitive
70+
warehouse: WAREHOUSE_NAME #case sensitive
71+
database: DATABASE_NAME #case cap sensitive
6472
```
6573
{% endcode %}
6674

sdk/python/docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
# Add any paths that contain custom static files (such as style sheets) here,
116116
# relative to this directory. They are copied after the builtin static files,
117117
# so a file named "default.css" will overwrite the builtin "default.css".
118-
html_static_path = []
118+
html_static_path = ["_static"]
119119

120120

121121
# -- Options for HTMLHelp output ------------------------------------------

sdk/python/docs/source/feast.infra.online_stores.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ feast.infra.online\_stores.redis module
5252
:undoc-members:
5353
:show-inheritance:
5454

55+
feast.infra.online\_stores.snowflake module
56+
-------------------------------------------
57+
58+
.. automodule:: feast.infra.online_stores.snowflake
59+
:members:
60+
:undoc-members:
61+
:show-inheritance:
62+
5563
feast.infra.online\_stores.sqlite module
5664
----------------------------------------
5765

sdk/python/docs/source/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,18 +250,21 @@ Sqlite Online Store
250250

251251
.. automodule:: feast.infra.online_stores.sqlite
252252
:members:
253+
:noindex:
253254

254255
Datastore Online Store
255256
----------------------
256257

257258
.. automodule:: feast.infra.online_stores.datastore
258259
:members:
260+
:noindex:
259261

260262
DynamoDB Online Store
261263
---------------------
262264

263265
.. automodule:: feast.infra.online_stores.dynamodb
264266
:members:
267+
:noindex:
265268

266269
Redis Online Store
267270
------------------

0 commit comments

Comments
 (0)