feast
feast copied to clipboard
feat: Implement Databricks Unity Catalog offline store integration
What this PR does / why we need it:
- Implemented DatabricksUCOfflineStoreConfig (inheriting from SparkOfflineStoreConfig) to specify workspace, token, cluster_id, default_catalog, and default_schema.
- Implemented get_databricks_session helper that securely handles active sessions or connects remotely using Databricks Connect V2 configurations.
- Implemented DatabricksUCOfflineStore which inherits from SparkOfflineStore, overriding operations to guarantee Databricks session initialization before executing queries.
- Registered "databricks_uc" in the first-class OFFLINE_STORE_CLASS_FOR_TYPE mapping.
Which issue(s) this PR fixes:
Partially Fixes - #6499
Checks
- [x] I've made sure the tests are passing.
- [x] My commits are signed off (
git commit -s) - [x] My PR title follows conventional commits format
Testing Strategy
- [x] Unit tests
- [ ] Integration tests
- [x] Manual tests
- [ ] Testing is not required for this change
@codex review
@falloficaruss Let's refactor this as:
- Rename
get_databricks_sessionhelper and use it as the Spark session factory when SparkOfflineStore needs to connect to Databricks. - Move to DataSource: The UC connection config (workspace host, catalog, schema, token) should become part of a new UnityCatalogSource (or IcebergRestCatalogSource).
- Enhance SparkOfflineStore: Teach
SparkOfflineStore.get_historical_features()to handleIcebergRestCatalogSource- when it sees one, use the Databricks Connect session to query the UC table via Spark. - The DatabricksUCOfflineStore subclass and "databricks_uc" type registration not needed if SparkOfflineStore itself handles the new DataSource.
@ntkathole review