[
https://issues.apache.org/jira/browse/ARROW-16005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Li resolved ARROW-16005.
------------------------------
Fix Version/s: 9.0.0
Resolution: Fixed
Issue resolved by pull request 12692
[https://github.com/apache/arrow/pull/12692]
> [Java] JDBC-to-Arrow: Arrays do not work with ArrowVectorIterator
> -----------------------------------------------------------------
>
> Key: ARROW-16005
> URL: https://issues.apache.org/jira/browse/ARROW-16005
> Project: Apache Arrow
> Issue Type: Bug
> Components: Java
> Affects Versions: 7.0.0
> Reporter: Thomas Powell
> Assignee: Thomas Powell
> Priority: Major
> Labels: pull-request-available
> Fix For: 9.0.0
>
> Time Spent: 3h 10m
> Remaining Estimate: 0h
>
> {{ArrowVectorIterator}} does not currently work with arrays.
> One issue is that initializing the {{ArrayConsumer}} requires
> {{ListVector#getDataVector}} but currently this is called before the
> {{VectorSchemaRoot}} is initialized so there is no {{ListVector}} to pass:
> [https://github.com/apache/arrow/blob/master/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/ArrowVectorIterator.java#L76.]
>
> {code:java}
> Caused by: java.lang.NullPointerException: Cannot invoke
> "org.apache.arrow.vector.complex.ListVector.getDataVector()" because "vector"
> is null
> at
> org.apache.arrow.adapter.jdbc.JdbcToArrowUtils.getConsumer(JdbcToArrowUtils.java:432)
> at
> org.apache.arrow.adapter.jdbc.ArrowVectorIterator.initialize(ArrowVectorIterator.java:74)
> at
> org.apache.arrow.adapter.jdbc.ArrowVectorIterator.create(ArrowVectorIterator.java:91)
> ... 72 more {code}
> A second issue comes when there are multiple batches.
> {{ArrayConsumer#resetValueVector}} does not currently do anything with the
> delegate. As a result, {{ListVector#dataVector}} does not have its index
> reset which is an issue when reusing the {{{}VectorSchemaRoot{}}}.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)