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

[Java] ArrowVectorIterator incorrectly closes Vectors #20476

Closed
asfimport opened this issue Oct 27, 2022 · 1 comment
Closed

[Java] ArrowVectorIterator incorrectly closes Vectors #20476

asfimport opened this issue Oct 27, 2022 · 1 comment

Comments

@asfimport
Copy link

If you’re using the iterator with reuseVectorSchemaRoot set to false, the first n-1 VSRs returned by a call to next() have their resources managed by the client code, but the last one gets closed when the iterator is closed. This is inconsistent and contradicts the  javadoc for next:

  • If {@link JdbcToArrowConfig#isReuseVectorSchemaRoot()} is false,

  • the client is responsible for freeing its resources.

    The iterator calls close on its CompositeJDBCConsumer instance, which in turn closes the vectors held by each consumer. 

     

    @Override
    public void close() {
      if (config.isReuseVectorSchemaRoot()) {
      nextBatch.close();
        }
      compositeConsumer.close();
    ``}

Reporter: Larry White / @lwhite1
Assignee: Larry White / @lwhite1

PRs and other links:

Note: This issue was originally created as ARROW-18178. Please see the migration documentation for further details.

@asfimport
Copy link
Author

David Li / @lidavidm:
Issue resolved by pull request 14534
#14534

@asfimport asfimport added this to the 11.0.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant