Feat: unity catalog/delta lake integration#145
Merged
beinan merged 7 commits intolance-format:mainfrom Mar 3, 2026
Merged
Conversation
Add SqlQuery and SqlEngine that let users run standard SQL directly against their datasets without requiring a GraphConfig. This is useful for data analytics workflows where users want explicit JOINs and aggregations against node/relationship tables. DataFusion handles SQL parsing and execution.
…r architecture
Add support for browsing and querying tables from Unity Catalog (OSS).
Inspired by Presto's connector SPI, the design cleanly separates:
- CatalogProvider trait: catalog metadata browsing (UC first, extensible
to Hive Metastore, AWS Glue, Iceberg REST Catalog)
- TableReader trait: format-specific data reading (Parquet + Delta Lake,
extensible to CSV, Iceberg, ORC)
- Connector struct: facade bundling catalog + readers
Key features:
- Full UC REST API client (list/get catalogs, schemas, tables, columns)
- UC type → Arrow type mapping (20 type mappings)
- ParquetTableReader via DataFusion register_parquet()
- DeltaTableReader via deltalake 0.29 (behind "delta" feature flag)
- Auto-register UC tables into SqlEngine via create_sql_engine()
- Python bindings: UnityCatalog, CatalogInfo, SchemaInfo, TableInfo
- 15 wiremock integration tests for UC REST client
- 12 type mapping unit tests
- 9 Python unit tests
Python API:
uc = UnityCatalog("http://localhost:8080/api/2.1/unity-catalog")
engine = uc.create_sql_engine("unity", "default")
result = engine.execute("SELECT * FROM my_table")
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
- cargo fmt fixes across all new files - Replace EnumName::Variant with Self::Variant (clippy::unnecessary_structure_name_repetition) - Fix Python import sorting and line length (ruff)
…re, GCS)
- Add `storage_options` parameter to `TableReader::register_table()` trait
- `Connector::with_storage_options()` stores credentials and passes them
to table readers during registration
- `DeltaTableReader` uses `open_table_with_storage_options()` when
storage options are provided
- Enable deltalake cloud features: s3, azure, gcs
- Python: `UnityCatalog(url, storage_options={...})` accepts cloud creds
Usage:
uc = UnityCatalog(
"http://localhost:8080/api/2.1/unity-catalog",
storage_options={
"azure_storage_account_name": "myaccount",
"azure_storage_account_key": "...",
}
)
engine = uc.create_sql_engine("unity", "default")
Add examples for UnityCatalog browsing, create_sql_engine, and cloud storage options (S3, Azure, GCS) to both project and Python READMEs.
beinan
approved these changes
Mar 3, 2026
Collaborator
beinan
left a comment
There was a problem hiding this comment.
let's merge this pr first due to the urgent use cases
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
SqlEngineCatalogProvider) and data format reading (TableReader)storage_optionsArchitecture
Inspired by Presto's connector SPI:
CatalogProvidertraitConnectorMetadata)TableReadertraitConnectorPageSourceProvider)ConnectorstructConnector)Extensibility:
CatalogProvider, reuses existing Delta/Parquet readersTableReader, works with any catalogPython API
```python
from lance_graph import UnityCatalog
Connect to Unity Catalog
uc = UnityCatalog("http://localhost:8080/api/2.1/unity-catalog")
Browse
catalogs = uc.list_catalogs()
tables = uc.list_tables("unity", "default")
table = uc.get_table("unity", "default", "marksheet")
print(table.columns())
Auto-register Delta + Parquet tables and query via SQL
engine = uc.create_sql_engine("unity", "default")
result = engine.execute("SELECT * FROM marksheet WHERE mark > 80")
Cloud storage support (S3, Azure, GCS)
uc = UnityCatalog(
"http://localhost:8080/api/2.1/unity-catalog",
storage_options={
"azure_storage_account_name": "myaccount",
"azure_storage_account_key": "...",
}
)
```
New files
SPI layer (`lance-graph-catalog`):
Implementation layer (`lance-graph`):
Python bindings (`lance-graph-python`):
Test plan