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.
Which issue does this PR close?
Closes #13827
Closes #13851
Rationale for this change
During testing with
delta-kernel-rs
anddatafusion-table-providers
it was discovered that there are multiple cases where table providers are spawning processes using tokio. Since these modules may be running in a different thread than the main executable, they do not have the tokio runtime. Here we are optionally adding in a tokio runtime reference so we an enter the runtime during calls to the record batch stream.In a recent change to DataFusion core, there has been a required change in the API for operating over the FFI boundary. With this change, it will break when someone attempts to load a module from DF43 into DF44. This PR addresses this by adding a
version()
function that will return the major version for which the module was compiled against. This will allow users to check for compatibility before attempting to use modules across the boundary.What changes are included in this PR?
We add a reference to the tokio runtime that is entered during calls to the record batch stream so we can spawn async processes during execution without panicing.
We add a single
version()
function at the root of the FFI API.We add an integration test that builds a module and loads it from another executable to test the FFI boundary. This has both a synchronous and an asynchronous table provider.
Are these changes tested?
These are tested against datafusion-python with a python wrapper around delta-kernel-rs. Additionally an integration test is added to this repository.
Are there any user-facing changes?
This exposes a new
version()
function in the FFI module and adds an new method for creatingFFI_TableProvider
with the runtime. The existingFrom<>
implementation still remains if the user is not spawning via tokio.