You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Larry White (Jira)" <ji...@apache.org> on 2022/10/27 17:34:00 UTC

[jira] [Updated] (ARROW-18178) [Java] ArrowVectorIterator incorrectly closes Vectors

     [ https://issues.apache.org/jira/browse/ARROW-18178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Larry White updated ARROW-18178:
--------------------------------
    Description: 
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();}}
{{}}}

  was:
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. 

{{/**}}
{{ * Clean up resources.}}
{{ */}}
{{@Override}}
{{public void close() {}}
{{  if (config.isReuseVectorSchemaRoot()) {}}
{{  nextBatch.close();}}
{{  }}}
{{  compositeConsumer.close();}}
{{}}}


> [Java] ArrowVectorIterator incorrectly closes Vectors 
> ------------------------------------------------------
>
>                 Key: ARROW-18178
>                 URL: https://issues.apache.org/jira/browse/ARROW-18178
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Java
>    Affects Versions: 10.0.0
>            Reporter: Larry White
>            Assignee: Larry White
>            Priority: Major
>
> 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();}}
> {{}}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)