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

[Java] Remove dependency on optional JDBC ResultSet method

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 8.0.0
    • 9.0.0
    • Java

    Description

      jswenson points out that the fix for ARROW-16035 uses the ResultSet.isLast() method, which is listed as optional for vendor support in the (likely common) condition that the result set is forward-scrollable only.  This new code replaced dependency on ResultSet.isAfterLast(), which is similarly annotated as optional in the same context (and has the additional challenge of being non-deterministic in the case of empty result sets).  To eliminate these dependencies, we propose the following:

      1. The ArrowVectorIterator returned from processing ResultSets will always have at least one element, meaning hasNext() will return true initially, even in the case of empty ResultSets.
      2. Calling ArrowVectorIterator.next() will establish whether there is actual data to be supplied, and will return an "empty" VectorSchemaRoot when an empty ResultSet was supplied originally.
      3. Subsequent calls to ArrowVectorIterator.hasNext() will return false in the case when an empty ResultSet was supplied.

      This is a behavior change, in that the current ARROW-16035-patched code returns false today when an empty ResultSet was supplied, and the JDBC driver optionally implements ResultSet.isLast().

      Attachments

        Issue Links

          Activity

            People

              toddfarmer Todd Farmer
              toddfarmer Todd Farmer
              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 - 40m
                  40m