You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Krisztian Szucs (Jira)" <ji...@apache.org> on 2022/07/27 13:00:00 UTC

[jira] [Updated] (ARROW-16035) [Java] Arrow to JDBC ArrowVectorIterator with does not terminate with empty result set

     [ https://issues.apache.org/jira/browse/ARROW-16035?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Krisztian Szucs updated ARROW-16035:
------------------------------------
    Fix Version/s: 9.0.0
                       (was: 8.0.0)

> [Java] Arrow to JDBC ArrowVectorIterator with does not terminate with empty result set
> --------------------------------------------------------------------------------------
>
>                 Key: ARROW-16035
>                 URL: https://issues.apache.org/jira/browse/ARROW-16035
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 7.0.0
>            Reporter: Jonathan Swenson
>            Assignee: Todd Farmer
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 9.0.0
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Using an ArrowVectorIterator built from a JDBC Result Set that is empty causes the iterator to never terminate. 
> {code:java}
> ArrowVectorIterator iterator =
>     JdbcToArrow.sqlToArrowVectorIterator(conn.createStatement()
>         .executeQuery("select 1 from table1 where false"), config); {code}
>  
> It appears as though this is due to the implementation of the [hasNext()|https://github.com/apache/arrow/blob/master/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/ArrowVectorIterator.java#L158] 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|https://docs.oracle.com/en/java/javase/11/docs/api/java.sql/java/sql/ResultSet.html#isAfterLast()] it will always return false when the result set is empty. 
> {quote}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
> {quote}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)