Allow extension libraries to contribute object stores over FFI
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start by reviewing the upstream datafusion-ffi prerequisite, since this repository has no FFI_ObjectStore or object-store module yet. Then inspect crates/core/src/context.rs and the SessionExtensionComponents design; done means an upstream FFI type exists, this project can import it through the capsule hook, and the extension bundle can optionally expose stores keyed by scheme.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem or challenge?
Split out of #1676, which proposed adding an object_stores field to SessionExtensionComponents so an extension library could declare its object stores alongside its codecs, functions, and providers and have with_extensions install everything in one call. The other fields in that issue are actionable and are being implemented; this one is blocked, so it is being tracked separately rather than holding up the rest.
An extension library that reads from a storage system datafusion-python does not know about has no way to contribute an object store. Every other extension point in the FFI surface — table providers, catalog providers, functions, codecs, query planners, physical optimizer rules — has a __datafusion_*__ capsule getter that lets a separately compiled library hand over an implementation. Object stores have none.
Describe the solution you'd like
Ultimately, a __datafusion_object_store__ capsule getter following the same convention as the rest of the protocol, so a library can export an ObjectStore implementation across the FFI boundary, plus an object_stores field on SessionExtensionComponents keyed by scheme.
This is blocked upstream and cannot be built here first. There is no FFI_ObjectStore in datafusion-ffi — no object-store module exists in the crate at all. Without one there is nothing for a capsule to carry.
The Python-side surface is also closed today. SessionContext.register_object_store takes StorageContexts, a closed enum over five built-in pyclasses (AmazonS3, GoogleCloudStorage, MicrosoftAzure, LocalFileSystem, HTTP), and crates/core/src/context.rs matches all five exhaustively to pull out an Arc<dyn ObjectStore>. There is no RustWrappedPyObjectStore equivalent to the wrappers the other extension points have. So even a Python-native path would need new work, and a third-party Rust cdylib could not participate at all — it would have to import datafusion.object_store and call back into the host to construct one of our own objects.
The dependency order is therefore: an FFI_ObjectStore upstream in datafusion-ffi, then an importer and __datafusion_object_store__ hook here, then optionally the object_stores bundle field.
Describe alternatives you've considered
What works today. A library that wants to ship a configured store returns one of datafusion-python's own objects and lets the caller register it:
ctx.register_object_store("s3://my-bucket", my_library.configured_s3_store())
That is one line and needs no protocol. It covers the case where the library is packaging credentials or endpoint configuration for a store datafusion-python already supports, which is probably the common case.
What it does not cover is a library implementing a genuinely new ObjectStore — an internal blob service, a content-addressed store, a caching layer in front of another store. That case needs the FFI type and has no workaround short of the library vendoring its own DataFusion.
Adding object_stores to SessionExtensionComponents anyway, carrying the five existing StorageContexts variants. Rejected in #1676: it would be the only field in that dataclass carrying nothing foreign, there would be no capsule to validate, and it would bake the format!("{scheme}{derived_host}") key construction into a tuple shape for no benefit over the one-line call above.
Additional context
Follow-up to #1676; see https://github.com/apache/datafusion-python/issues/1676#issuecomment-5680959562 for the analysis this was split out of. Blocked on an upstream datafusion-ffi change — worth raising in apache/datafusion before any work starts here.
- Ngôn ngữ chính
- Python
- Star
- 605
- Fork
- 176
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 8
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/datafusion-python
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/datafusion-python#1726 ·
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 88/100
apache/datafusion-python#1691 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/datafusion-python#1644 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
apache/datafusion-python#1735 · 1 bình luận ·
-
bug good first issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
apache/datafusion-python#1728 ·
Tất cả issue của apache/datafusion-python
Issue tương tự
-
documentation help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
simonw/sqlite-utils#872 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100