-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Add Oracle DB as Offline store in python sdk & operator #6017
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
ntkathole
merged 40 commits into
feast-dev:master
from
aniketpalu:oracle-db-offline-store
Mar 14, 2026
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
cff3a63
feat: Add Oracle DB as Offline store in python sdk & support in feas…
aniketpalu 60f8d92
Added oracle db dependency from ibis-framework subgroups
aniketpalu 9f00168
Operator yaml changes
aniketpalu 07e6969
Data source writer ignored parameters, fixed
aniketpalu 1fb6720
Replaced raw sql with dedicated truncate_table() to fix SQL Injection…
aniketpalu 3abef8c
Minor improvements like single db connection, removal of default cred…
aniketpalu b991288
Fetching pre-filtered table from db
aniketpalu af7e7ee
Minor formatting changes
aniketpalu 41e0901
Added Oracle DB Offline Store documentation
aniketpalu d4387a8
Resolved import error by removing OracleSource import from the __init__
aniketpalu b0e96d0
Fixed lint error by updating secret baseline
aniketpalu 07c5e9a
fix: Exclude qdrant from docstring tests to avoid qdrant-client 1.17.…
aniketpalu be03d88
Generated secret.baseline to avoid lint error
aniketpalu c36299f
Fixed lint error
aniketpalu 7e648c0
Updated .secrets.baseline
aniketpalu 7573690
Fixed lint errors
aniketpalu 1a78577
Fixed lint errors
aniketpalu 8fc6190
Update sdk/python/feast/type_map.py
aniketpalu 1f63beb
Updated dependency lock files
aniketpalu 33c0b38
Fixed lint issues in Trino Offline Store
aniketpalu 04adc97
Merge branch 'master' into oracle-db-offline-store
aniketpalu e91fa8d
Updated requirements
aniketpalu caed7c8
Updated pixi.lock file
aniketpalu de9759e
Merge branch 'master' into oracle-db-offline-store
aniketpalu e40a355
Merge branch 'master' into oracle-db-offline-store
aniketpalu c71cdfd
Merge branch 'master' into oracle-db-offline-store
aniketpalu 9a20c65
Merge branch 'master' into oracle-db-offline-store
aniketpalu 9880a56
Merge branch 'master' into oracle-db-offline-store
aniketpalu 5335b0d
Restricted non-empty feature_views in get_historical_features() to av…
aniketpalu c706b0b
Removed _build_data_source_reader_for_retrieval function
aniketpalu 414c0e0
Modified initial query to be _ to avoid empty string casting to Null …
aniketpalu 5b84e73
cast DATE to TIMESTAMP in _read_oracle_table to preserve time lost by…
aniketpalu 92f78ca
Use single database connection for pull_latest_from_table_or_query()
aniketpalu c79ba55
Improved readibility by breaking down the code into functions
aniketpalu 95f7f55
Merge branch 'master' into oracle-db-offline-store
aniketpalu 1181be1
Merge branch 'master' into oracle-db-offline-store
aniketpalu b54c2a2
Updated .secret.baseline
aniketpalu fe797ed
Updated .secret.baseline and pixi.lock
aniketpalu 466e2d2
Fixed lint issue
aniketpalu 7670a90
Conflicts resolved
aniketpalu 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Oracle source (contrib) | ||
|
|
||
| ## Description | ||
|
|
||
| Oracle data sources are Oracle database tables. | ||
| These are specified by a table reference (e.g. `"TRANSACTION_FEATURES"` or `"SCHEMA.TABLE"`). | ||
|
|
||
| ## Disclaimer | ||
|
|
||
| The Oracle data source does not achieve full test coverage. | ||
| Please do not assume complete stability. | ||
|
|
||
| ## Examples | ||
|
|
||
| Defining an Oracle source: | ||
|
|
||
| ```python | ||
| from feast.infra.offline_stores.contrib.oracle_offline_store.oracle_source import ( | ||
| OracleSource, | ||
| ) | ||
|
|
||
| driver_stats_source = OracleSource( | ||
| name="driver_hourly_stats", | ||
| table_ref="DRIVER_HOURLY_STATS", | ||
| event_timestamp_column="EVENT_TIMESTAMP", | ||
| created_timestamp_column="CREATED", | ||
| ) | ||
| ``` | ||
|
|
||
| **Note:** Oracle stores unquoted identifiers in uppercase. Reference columns using the casing shown by Oracle (e.g. `USER_ID` for unquoted identifiers). | ||
|
|
||
| ## Supported Types | ||
|
|
||
| Oracle data sources support standard Oracle numeric, string, date, and timestamp types mapped through the ibis Oracle backend. | ||
| For a comparison against other batch data sources, please see [here](overview.md#functionality-matrix). | ||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| # Oracle offline store (contrib) | ||
|
|
||
| ## Description | ||
|
|
||
| The Oracle offline store provides support for reading [OracleSources](../data-sources/oracle.md). | ||
| * Entity dataframes can be provided as a SQL query or as a Pandas dataframe. | ||
| * Uses the [ibis](https://ibis-project.org/) Oracle backend (`ibis.oracle`) for all database interactions. | ||
| * Only one of `service_name`, `sid`, or `dsn` may be set in the configuration. | ||
|
|
||
| ## Disclaimer | ||
|
|
||
| The Oracle offline store does not achieve full test coverage. | ||
| Please do not assume complete stability. | ||
|
|
||
| ## Getting started | ||
|
|
||
| Install the Oracle extras: | ||
|
|
||
| ```bash | ||
| pip install 'feast[oracle]' | ||
| ``` | ||
|
|
||
| ## Example | ||
|
|
||
| {% code title="feature_store.yaml" %} | ||
| ```yaml | ||
| project: my_project | ||
| registry: data/registry.db | ||
| provider: local | ||
| offline_store: | ||
| type: oracle | ||
| host: DB_HOST | ||
| port: 1521 | ||
| user: DB_USERNAME | ||
| password: DB_PASSWORD | ||
| service_name: ORCL | ||
| online_store: | ||
| path: data/online_store.db | ||
| ``` | ||
| {% endcode %} | ||
|
|
||
| Connection can alternatively use `sid` or `dsn` instead of `service_name`: | ||
|
|
||
| ```yaml | ||
| # Using SID | ||
| offline_store: | ||
| type: oracle | ||
| host: DB_HOST | ||
| port: 1521 | ||
| user: DB_USERNAME | ||
| password: DB_PASSWORD | ||
| sid: ORCL | ||
|
|
||
| # Using DSN | ||
| offline_store: | ||
| type: oracle | ||
| host: DB_HOST | ||
| port: 1521 | ||
| user: DB_USERNAME | ||
| password: DB_PASSWORD | ||
| dsn: "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DB_HOST)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)))" | ||
| ``` | ||
|
|
||
| ### Configuration reference | ||
|
|
||
| | Parameter | Required | Default | Description | | ||
| | :------------- | :------- | :---------- | :------------------------------------------------------- | | ||
| | `type` | yes | — | Must be set to `oracle` | | ||
| | `user` | yes | — | Oracle database user | | ||
| | `password` | yes | — | Oracle database password | | ||
| | `host` | no | `localhost` | Oracle database host | | ||
| | `port` | no | `1521` | Oracle database port | | ||
| | `service_name` | no | — | Oracle service name (mutually exclusive with sid and dsn) | | ||
| | `sid` | no | — | Oracle SID (mutually exclusive with service_name and dsn) | | ||
| | `database` | no | — | Oracle database name | | ||
| | `dsn` | no | — | Oracle DSN string (mutually exclusive with service_name and sid) | | ||
|
|
||
| ## Functionality Matrix | ||
|
|
||
| The set of functionality supported by offline stores is described in detail [here](overview.md#functionality). | ||
| Below is a matrix indicating which functionality is supported by the Oracle offline store. | ||
|
|
||
| | | Oracle | | ||
| | :----------------------------------------------------------------- | :----- | | ||
| | `get_historical_features` (point-in-time correct join) | yes | | ||
| | `pull_latest_from_table_or_query` (retrieve latest feature values) | yes | | ||
| | `pull_all_from_table_or_query` (retrieve a saved dataset) | yes | | ||
| | `offline_write_batch` (persist dataframes to offline store) | yes | | ||
| | `write_logged_features` (persist logged features to offline store) | yes | | ||
|
|
||
| Below is a matrix indicating which functionality is supported by `OracleRetrievalJob`. | ||
|
|
||
| | | Oracle | | ||
| | ----------------------------------------------------- | ------ | | ||
| | export to dataframe | yes | | ||
| | export to arrow table | yes | | ||
| | export to arrow batches | no | | ||
| | export to SQL | no | | ||
| | export to data lake (S3, GCS, etc.) | no | | ||
| | export to data warehouse | no | | ||
| | export as Spark dataframe | no | | ||
| | local execution of Python-based on-demand transforms | yes | | ||
| | remote execution of Python-based on-demand transforms | no | | ||
| | persist results in the offline store | yes | | ||
| | preview the query plan before execution | no | | ||
| | read partitioned data | no | | ||
|
|
||
| To compare this set of functionality against other offline stores, please see the full [functionality matrix](overview.md#functionality-matrix). | ||
|
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
1 change: 1 addition & 0 deletions
1
sdk/python/feast/infra/offline_stores/contrib/oracle_offline_store/__init__.py
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 @@ | ||
|
|
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.
Uh oh!
There was an error while loading. Please reload this page.