drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Khurram Faraaz (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-3766) ResultSet.getRow() returns incorrect row number of current row
Date Fri, 11 Sep 2015 08:07:45 GMT
Khurram Faraaz created DRILL-3766:
-------------------------------------

             Summary: ResultSet.getRow() returns incorrect row number of current row
                 Key: DRILL-3766
                 URL: https://issues.apache.org/jira/browse/DRILL-3766
             Project: Apache Drill
          Issue Type: Bug
          Components: Client - JDBC
    Affects Versions: 1.2.0
            Reporter: Khurram Faraaz
            Assignee: Daniel Barclay (Drill)


getRow() function returns incorrect row number for current row. It returns one less than the
actual row number. The first row should be row number 1 and second row is row number 2 and
so on as per javadoc for getRow()

{code}
                String query = "select * from FEWRWSPQQ_101";
                
                ResultSet rs = stmt.executeQuery(query);
                ResultSetMetaData rsmd = rs.getMetaData();

                while (rs.next()) {
                      System.out.println(" row Number :"+rs.getRow());
                }
{code}

Output of call to getRow() in the while loop.
{code}
row Number :0
 row Number :1
 row Number :2
 row Number :3
 row Number :4
 row Number :5
 row Number :6
 row Number :7
 row Number :8
 row Number :9
 row Number :10
 row Number :11
 row Number :12
 row Number :13
 row Number :14
 row Number :15
 row Number :16
 row Number :17
 row Number :18
 row Number :19
 row Number :20
 row Number :21
{code}

Table has twenty two rows in it.
{code}
0: jdbc:drill:schema=dfs.tmp> select count(*) from FEWRWSPQQ_101;
+---------+
| EXPR$0  |
+---------+
| 22      |
+---------+
1 row selected (0.266 seconds)
{code}

>From javadoc

{code}
int getRow()
           throws SQLException
Retrieves the current row number. The first row is number 1, the second number 2, and so on.
Note:Support for the getRow method is optional for ResultSets with a result set type of TYPE_FORWARD_ONLY

Returns:
the current row number; 0 if there is no current row
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message