You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Thomas Powell (Jira)" <ji...@apache.org> on 2022/03/22 16:40:00 UTC

[jira] [Commented] (ARROW-16005) [Java] JDBC-to-Arrow: Arrays do not work with ArrowVectorIterator

    [ https://issues.apache.org/jira/browse/ARROW-16005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17510740#comment-17510740 ] 

Thomas Powell commented on ARROW-16005:
---------------------------------------

Started a fix in 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
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 50m
>  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.1#820001)