Skip to content

feat: Implement FFI_TableProviderFactory#17994

Closed
Weijun-H wants to merge 1 commit intoapache:mainfrom
Weijun-H:17942-ffi-table-provider-factory
Closed

feat: Implement FFI_TableProviderFactory#17994
Weijun-H wants to merge 1 commit intoapache:mainfrom
Weijun-H:17942-ffi-table-provider-factory

Conversation

@Weijun-H
Copy link
Member

@Weijun-H Weijun-H commented Oct 9, 2025

Which issue does this PR close?

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

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.

@github-actions github-actions bot added the ffi Changes to the ffi crate label Oct 9, 2025
@Weijun-H Weijun-H requested a review from timsaucer October 9, 2025 13:07
@timsaucer
Copy link
Member

I'm sorry I haven't had a chance to review this in detail. One thing we need is an integration test, similar to those in datafusion/ffi/tests and their correspond portion in datafusion/ffi/src/tests. The reason this is needed is because we need to build a provider in a different library than the one testing it to ensure we can safely cross the FFI boundary.

@timsaucer
Copy link
Member

Would you be able to add the test suggested above?

@github-actions
Copy link

Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale PR has not had any activity for some time label Jan 23, 2026
@github-actions github-actions bot closed this Feb 6, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 21, 2026
> ## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ffi Changes to the ffi crate Stale PR has not had any activity for some time

Projects

None yet

Development

Successfully merging this pull request may close these issues.

expose TableProviderFactory via FFI

2 participants