Skip to content

Commit 0d63ced

Browse files
davispWeijun-H
andauthored
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/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ pub mod record_batch_stream;
3939
pub mod schema_provider;
4040
pub mod session;
4141
pub mod table_provider;
42+
pub mod table_provider_factory;
4243
pub mod table_source;
4344
pub mod udaf;
4445
pub mod udf;

0 commit comments

Comments
 (0)