-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Hybrid offline store #5510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c738a8e
add hybrid offline store
HaoXuAI b765b5e
add hybrid offline store
HaoXuAI fd695e8
fix source type
HaoXuAI 02b2cdb
update doc
HaoXuAI bc379f5
update doc
HaoXuAI d338885
update doc
HaoXuAI 5af1cf2
update doc
HaoXuAI File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Hybrid Offline Store | ||
|
||
## Description | ||
The HybridOfflineStore allows routing offline feature operations to different offline store backends based on the `batch_source` of the FeatureView. This enables a single Feast deployment to support multiple offline store backends, each configured independently and selected dynamically at runtime. | ||
|
||
## Getting started | ||
To use the HybridOfflineStore, install Feast with all required offline store dependencies (e.g., BigQuery, Snowflake, etc.) for the stores you plan to use. For example: | ||
|
||
```bash | ||
pip install 'feast[spark,snowflake]' | ||
``` | ||
|
||
## Example | ||
|
||
{% code title="feature_store.yaml" %} | ||
```yaml | ||
project: my_feature_repo | ||
registry: data/registry.db | ||
provider: local | ||
offline_store: | ||
type: hybrid_offline_store.HybridOfflineStore | ||
offline_stores: | ||
- type: spark | ||
conf: | ||
spark_master: local[*] | ||
spark_app_name: feast_spark_app | ||
- type: snowflake | ||
conf: | ||
account: my_snowflake_account | ||
user: feast_user | ||
password: feast_password | ||
database: feast_database | ||
schema: feast_schema | ||
``` | ||
{% endcode %} | ||
|
||
### Example FeatureView | ||
```python | ||
from feast import FeatureView, Entity, ValueType | ||
from feast.infra.offline_stores.contrib.spark_offline_store.spark_source import ( | ||
SparkSource, | ||
) | ||
from feast.infra.offline_stores.snowflake_source import SnowflakeSource | ||
|
||
|
||
entity = Entity(name="user_id", value_type=ValueType.INT64, join_keys=["user_id"]) | ||
feature_view1 = FeatureView( | ||
name="user_features", | ||
entities=["user_id"], | ||
ttl=None, | ||
features=[ | ||
# Define your features here | ||
], | ||
source=SparkSource( | ||
path="s3://my-bucket/user_features_data", | ||
), | ||
) | ||
|
||
feature_view2 = FeatureView( | ||
name="user_activity", | ||
entities=["user_id"], | ||
ttl=None, | ||
features=[ | ||
# Define your features here | ||
], | ||
source=SnowflakeSource( | ||
path="s3://my-bucket/user_activity_data", | ||
), | ||
) | ||
|
||
``` | ||
|
||
Then you can use materialize API to materialize the data from the specified offline store based on the `batch_source` of the FeatureView. | ||
|
||
```python | ||
from feast import FeatureStore | ||
store = FeatureStore(repo_path=".") | ||
store.materialize( | ||
start_date="2025-01-01", | ||
end_date="2025-07-31", | ||
feature_views=[feature_view1, feature_view2], | ||
) | ||
``` | ||
|
||
## Functionality Matrix | ||
| Feature/Functionality | Supported | | ||
|---------------------------------------------------|----------------------------| | ||
| pull_latest_from_table_or_query | Yes | | ||
| pull_all_from_table_or_query | Yes | | ||
| offline_write_batch | Yes | | ||
| validate_data_source | Yes | | ||
| get_table_column_names_and_types_from_data_source | Yes | | ||
| write_logged_features | No | | ||
| get_historical_features | Only with same data source | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just add all of this now ? is the scope large?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it will have to update the protobuf and someother places, which will do it in next PR