liyafan82 commented on a change in pull request #10983:
URL: https://github.com/apache/arrow/pull/10983#discussion_r702552067
##########
File path:
java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/ArrowVectorIterator.java
##########
@@ -137,48 +139,46 @@ private VectorSchemaRoot createVectorSchemaRoot() {
// Loads the next schema root or null if no more rows are available.
private void load(VectorSchemaRoot root) throws SQLException {
-
- for (int i = 1; i <= consumers.length; i++) {
- consumers[i -
1].resetValueVector(root.getVector(rsmd.getColumnLabel(i)));
+ for (int i = 0; i < consumers.length; i++) {
+ consumers[i].resetValueVector(root.getVector(i));
}
consumeData(root);
-
- if (root.getRowCount() == 0) {
- root.close();
- nextBatch = null;
- } else {
- nextBatch = root;
- }
}
@Override
public boolean hasNext() {
- return nextBatch != null;
+ try {
+ return !resultSet.isAfterLast();
Review comment:
I think so.
`isAfterLast` is a public API of interface `java.sql.ResultSet`
(https://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html#isAfterLast()),
so it is supposed to be supported by each legitimate implementation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]