Skip to content

Commit adc2939

Browse files
authored
docs: Add DuckDB offline store (feast-dev#4174)
1 parent ee51fbf commit adc2939

6 files changed

Lines changed: 78 additions & 21 deletions

File tree

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
* [Snowflake](reference/offline-stores/snowflake.md)
8181
* [BigQuery](reference/offline-stores/bigquery.md)
8282
* [Redshift](reference/offline-stores/redshift.md)
83+
* [DuckDB](reference/offline-stores/duckdb.md)
8384
* [Spark (contrib)](reference/offline-stores/spark.md)
8485
* [PostgreSQL (contrib)](reference/offline-stores/postgres.md)
8586
* [Trino (contrib)](reference/offline-stores/trino.md)

docs/reference/data-sources/file.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
## Description
44

55
File data sources are files on disk or on S3.
6-
Currently only Parquet files are supported.
7-
8-
{% hint style="warning" %}
9-
FileSource is meant for development purposes only and is not optimized for production use.
10-
{% endhint %}
6+
Currently only Parquet and Delta formats are supported.
117

128
## Example
139

docs/reference/data-sources/overview.md

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

33
## Functionality
44

5-
In Feast, each batch data source is associated with a corresponding offline store.
6-
For example, a `SnowflakeSource` can only be processed by the Snowflake offline store.
5+
In Feast, each batch data source is associated with corresponding offline stores.
6+
For example, a `SnowflakeSource` can only be processed by the Snowflake offline store, while a `FileSource` can be processed by both File and DuckDB offline stores.
77
Otherwise, the primary difference between batch data sources is the set of supported types.
88
Feast has an internal type system, and aims to support eight primitive types (`bytes`, `string`, `int32`, `int64`, `float32`, `float64`, `bool`, and `timestamp`) along with the corresponding array types.
99
However, not every batch data source supports all of these types.

docs/reference/offline-stores/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ Please see [Offline Store](../../getting-started/architecture-and-components/off
2222
[redshift.md](redshift.md)
2323
{% endcontent-ref %}
2424

25+
{% content-ref url="duckdb.md" %}
26+
[duckdb.md](duckdb.md)
27+
{% endcontent-ref %}
28+
2529
{% content-ref url="spark.md" %}
2630
[spark.md](spark.md)
2731
{% endcontent-ref %}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# DuckDB offline store
2+
3+
## Description
4+
5+
The duckdb offline store provides support for reading [FileSources](../data-sources/file.md). It can read both Parquet and Delta formats. DuckDB offline store uses [ibis](https://ibis-project.org/) under the hood to convert offline store operations to DuckDB queries.
6+
7+
* Entity dataframes can be provided as a Pandas dataframe.
8+
9+
## Getting started
10+
In order to use this offline store, you'll need to run `pip install 'feast[duckdb]'`.
11+
12+
## Example
13+
14+
{% code title="feature_store.yaml" %}
15+
```yaml
16+
project: my_project
17+
registry: data/registry.db
18+
provider: local
19+
offline_store:
20+
type: duckdb
21+
online_store:
22+
path: data/online_store.db
23+
```
24+
{% endcode %}
25+
26+
## Functionality Matrix
27+
28+
The set of functionality supported by offline stores is described in detail [here](overview.md#functionality).
29+
Below is a matrix indicating which functionality is supported by the DuckDB offline store.
30+
31+
| | DuckdDB |
32+
| :----------------------------------------------------------------- | :---- |
33+
| `get_historical_features` (point-in-time correct join) | yes |
34+
| `pull_latest_from_table_or_query` (retrieve latest feature values) | yes |
35+
| `pull_all_from_table_or_query` (retrieve a saved dataset) | yes |
36+
| `offline_write_batch` (persist dataframes to offline store) | yes |
37+
| `write_logged_features` (persist logged features to offline store) | yes |
38+
39+
Below is a matrix indicating which functionality is supported by `IbisRetrievalJob`.
40+
41+
| | DuckDB|
42+
| ----------------------------------------------------- | ----- |
43+
| export to dataframe | yes |
44+
| export to arrow table | yes |
45+
| export to arrow batches | no |
46+
| export to SQL | no |
47+
| export to data lake (S3, GCS, etc.) | no |
48+
| export to data warehouse | no |
49+
| export as Spark dataframe | no |
50+
| local execution of Python-based on-demand transforms | yes |
51+
| remote execution of Python-based on-demand transforms | no |
52+
| persist results in the offline store | yes |
53+
| preview the query plan before execution | no |
54+
| read partitioned data | yes |
55+
56+
To compare this set of functionality against other offline stores, please see the full [functionality matrix](overview.md#functionality-matrix).

docs/reference/offline-stores/overview.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ Below is a matrix indicating which offline stores support which methods.
4242

4343
Below is a matrix indicating which `RetrievalJob`s support what functionality.
4444

45-
| | File | BigQuery | Snowflake | Redshift | Postgres | Spark | Trino |
46-
| --------------------------------- | --- | --- | --- | --- | --- | --- | --- |
47-
| export to dataframe | yes | yes | yes | yes | yes | yes | yes |
48-
| export to arrow table | yes | yes | yes | yes | yes | yes | yes |
49-
| export to arrow batches | no | no | no | yes | no | no | no |
50-
| export to SQL | no | yes | yes | yes | yes | no | yes |
51-
| export to data lake (S3, GCS, etc.) | no | no | yes | no | yes | no | no |
52-
| export to data warehouse | no | yes | yes | yes | yes | no | no |
53-
| export as Spark dataframe | no | no | yes | no | no | yes | no |
54-
| local execution of Python-based on-demand transforms | yes | yes | yes | yes | yes | no | yes |
55-
| remote execution of Python-based on-demand transforms | no | no | no | no | no | no | no |
56-
| persist results in the offline store | yes | yes | yes | yes | yes | yes | no |
57-
| preview the query plan before execution | yes | yes | yes | yes | yes | yes | yes |
58-
| read partitioned data | yes | yes | yes | yes | yes | yes | yes |
45+
| | File | BigQuery | Snowflake | Redshift | Postgres | Spark | Trino | DuckDB |
46+
| --------------------------------- | --- | --- | --- | --- | --- | --- | --- | --- |
47+
| export to dataframe | yes | yes | yes | yes | yes | yes | yes | yes |
48+
| export to arrow table | yes | yes | yes | yes | yes | yes | yes | yes |
49+
| export to arrow batches | no | no | no | yes | no | no | no | no |
50+
| export to SQL | no | yes | yes | yes | yes | no | yes | no |
51+
| export to data lake (S3, GCS, etc.) | no | no | yes | no | yes | no | no | no |
52+
| export to data warehouse | no | yes | yes | yes | yes | no | no | no |
53+
| export as Spark dataframe | no | no | yes | no | no | yes | no | no |
54+
| local execution of Python-based on-demand transforms | yes | yes | yes | yes | yes | no | yes | yes |
55+
| remote execution of Python-based on-demand transforms | no | no | no | no | no | no | no | no |
56+
| persist results in the offline store | yes | yes | yes | yes | yes | yes | no | yes |
57+
| preview the query plan before execution | yes | yes | yes | yes | yes | yes | yes | no |
58+
| read partitioned data | yes | yes | yes | yes | yes | yes | yes | yes |

0 commit comments

Comments
 (0)