Todd Farmer created ARROW-16529:
-----------------------------------
Summary: [Java] Remove dependency on optional JDBC ResultSet method
Key: ARROW-16529
URL: https://issues.apache.org/jira/browse/ARROW-16529
Project: Apache Arrow
Issue Type: Improvement
Components: Java
Affects Versions: 8.0.0
Reporter: Todd Farmer
Assignee: Todd Farmer
[~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:
# 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.
# 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.
# 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().
--
This message was sent by Atlassian Jira
(v8.20.7#820007)