-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Implement FFI_TaskContext and FFI_TaskContextProvider #18679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
+1,841
−560
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
12f317d to
6d48b25
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
core
Core DataFusion crate
documentation
Improvements or additions to documentation
execution
Related to the execution crate
ffi
Changes to the ffi crate
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?
Note: This is based on top of #18672. I will rebase after that one merges to remove the parts of the code that are not relevant to this PR.
Rationale for this change
This PR solves one of the biggest problems we have in using user defined functions together via FFI. The justification is included in the
README.mdfile in this PR. In order to de/serialize any expressions, either logical or physical, we need to know what functions have been registered. This is not possible to do if we cannot access the current list of registered functions.This causes a circular dependency if we want to use registered functions as parts of expressions to other registered functions. The encoding and decoding of these functions will fail. This PR adds a weak reference to a trait that can access the current
TaskContextto be used for the protobuf de/serialization.What changes are included in this PR?
TaskContextProviderthat is used to get the current task context.FFI_TaskContextandFFI_TaskContextProviderFFI_TaskContextProviderthroughout any of the FFI code that requires protobof encoding and decoding.SessionContextas aTaskContextProviderAre these changes tested?
The unit tests have been updated. Additionally this has been tested against
datafusion-pythonAre there any user-facing changes?
This is an API change for FFI.