Skip to content

Avoid closing/freeing struct-like object instances on import #765

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
pepijnve opened this issue May 23, 2025 · 0 comments · Fixed by #766
Closed

Avoid closing/freeing struct-like object instances on import #765

pepijnve opened this issue May 23, 2025 · 0 comments · Fixed by #766
Labels
Type: enhancement New feature or request

Comments

@pepijnve
Copy link
Contributor

Describe the enhancement requested

Currently the various import methods in org.apache.arrow.c.Data call close on the BaseStruct arguments they receive as parameter. This prevents callers from reusing these objects multiple times. Since the caller needs to allocate these objects themselves, it seems like it would be more consistent to also expect the caller to free them. This works well in combination with try-with-resources.

See related discussion #763.

@pepijnve pepijnve added the Type: enhancement New feature or request label May 23, 2025
pepijnve added a commit to datadobi/arrow-java that referenced this issue May 23, 2025
pepijnve added a commit to datadobi/arrow-java that referenced this issue May 23, 2025
pepijnve added a commit to datadobi/arrow-java that referenced this issue May 27, 2025
pepijnve added a commit to datadobi/arrow-java that referenced this issue May 27, 2025
pepijnve added a commit to datadobi/arrow-java that referenced this issue May 27, 2025
pepijnve added a commit to datadobi/arrow-java that referenced this issue May 27, 2025
pepijnve added a commit to datadobi/arrow-java that referenced this issue May 27, 2025
lidavidm pushed a commit that referenced this issue May 28, 2025
## What's Changed

This PR removes the direct and indirect calls to `BaseStruct#close` from
`org.apache.arrow.c.Data`. By not eagerly closing/freeing these objects
callers can reuse instances multiple times.

Closes #765.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant