Skip to content
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

Simplify ffi import/export #4447

Merged
merged 1 commit into from
Jun 27, 2023
Merged

Simplify ffi import/export #4447

merged 1 commit into from
Jun 27, 2023

Conversation

Virgiel
Copy link
Contributor

@Virgiel Virgiel commented Jun 23, 2023

Which issue does this PR close?

Closes #4444

Rationale for this change

This simplification removes redundant code and simplifies the ffi logic around two functions :

pub fn to_ffi(data: &ArrayData) -> Result<(FFI_ArrowArray, FFI_ArrowSchema)> { }
pub fn from_ffi(array: FFI_ArrowArray, schema: &FFI_ArrowSchema) -> Result<ArrayData> {}

What changes are included in this PR?

The ArrowArray, ArrowArrayChild and ArrowArrayRef logic is hidden and simplified, but the internal logic remains the same.

Are there any user-facing changes?

ArrowArray is replaced with two functions : from_ffi and to_ffi.

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jun 23, 2023
@Virgiel Virgiel marked this pull request as ready for review June 23, 2023 14:01
@tustvold tustvold added the api-change Changes to the arrow API label Jun 26, 2023
Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me, perhaps @viirya might be able to take a look as I believe you have more experience with this part of the codebase

arrow/src/ffi.rs Outdated Show resolved Hide resolved
@tustvold tustvold merged commit 45cc770 into apache:master Jun 27, 2023
@Virgiel Virgiel deleted the clean-ffi branch June 27, 2023 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change Changes to the arrow API arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reuse schema when importing from FFI
3 participants