Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-16005

[Java] JDBC-to-Arrow: Arrays do not work with ArrowVectorIterator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 7.0.0
    • 9.0.0
    • Java

    Description

      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. 

      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 

      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

      Attachments

        Issue Links

          Activity

            People

              tom-s-powell Thomas Powell
              tom-s-powell Thomas Powell
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 10m
                  3h 10m