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

[Java] Arrow to JDBC ArrowVectorIterator with does not terminate with empty result set

Details

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

    Description

      Using an ArrowVectorIterator built from a JDBC Result Set that is empty causes the iterator to never terminate. 

      ArrowVectorIterator iterator =
          JdbcToArrow.sqlToArrowVectorIterator(conn.createStatement()
              .executeQuery("select 1 from table1 where false"), config); 

       

      It appears as though this is due to the implementation of the hasNext() method.

      The expectation is that the `isAfterLast()` method on a JDBC result set return true when the result set is empty. However, according to the JDBC documentation it will always return false when the result set is empty. 

      Returns:true if the cursor is after the last row; false if the cursor is at any other position or the result set contains no rows

       

      Attachments

        Issue Links

          Activity

            People

              toddfarmer Todd Farmer
              jswenson Jonathan Swenson
              Votes:
              0 Vote for this issue
              Watchers:
              5 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
                  1h

                  Slack

                    Issue deployment