Commit 0d63ced
Implement FFI table provider factory (#20326)
> ## Which issue does this PR close?
> * Closes [expose TableProviderFactory via
FFI #17942](#17942)
>
This PR is re-opening PR #17994 and updating it to match the current FFI
approach (I.e., I made it look like the FFI_TableProvider in various
places).
> ## Rationale for this change
> Expose `TableProviderFactory` via FFI to enable external languages
(e.g., Python) to implement custom table provider factories and extend
DataFusion with new data source types.
>
> ## What changes are included in this PR?
> * Added `datafusion/ffi/src/table_provider_factory.rs` with:
>
> * `FFI_TableProviderFactory`: Stable C ABI struct with function
pointers for `create`, `clone`, `release`, and `version`
> * `ForeignTableProviderFactory`: Wrapper implementing
`TableProviderFactory` trait
>
> ## Are these changes tested?
> Yes
>
I've also added the integration tests as requested in the original PR.
> ## Are there any user-facing changes?
> Yes - new FFI API that enables custom `TableProviderFactory`
implementations in foreign languages. This is an additive change with no
breaking changes to existing APIs.
Also, I'd like to thank @Weijun-H for the initial version of this PR as
it simplified getting up to speed on the serialization logic that I
hadn't encountered yet.
---------
Co-authored-by: Weijun-H <huangweijun1001@gmail.com>1 parent 1736fd2 commit 0d63ced
5 files changed
Lines changed: 550 additions & 3 deletions
File tree
- datafusion/ffi
- src
- tests
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
0 commit comments