Thomas Powell created ARROW-16005:
-------------------------------------

             Summary: [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


{{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.1#820001)

Reply via email to