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

[Java] ArrowVectorIterator incorrectly closes Vectors

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 10.0.0
    • 11.0.0
    • Java

    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();
      }

      Attachments

        Issue Links

          Activity

            People

              ljw1001 Larry White
              ljw1001 Larry White
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 1h 20m
                  1h 20m