hadoop-hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject svn commit: r762900 - in /hadoop/hive/trunk: CHANGES.txt jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSet.java jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java
Date Tue, 07 Apr 2009 18:44:32 GMT
Author: namit
Date: Tue Apr  7 18:44:32 2009
New Revision: 762900

URL: http://svn.apache.org/viewvc?rev=762900&view=rev
Log:
HIVE-381. Fix JDBC HiveResultSet's next function.
(Kim P via namit)



Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSet.java
    hadoop/hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=762900&r1=762899&r2=762900&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Tue Apr  7 18:44:32 2009
@@ -15,6 +15,9 @@
 
   BUG FIXES
 
+    HIVE-381. Fix JDBC HiveResultSet's next function.
+    (Kim P via namit)
+
 Release 0.3.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSet.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSet.java?rev=762900&r1=762899&r2=762900&view=diff
==============================================================================
--- hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSet.java (original)
+++ hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSet.java Tue Apr
 7 18:44:32 2009
@@ -981,7 +981,7 @@
    */
 
   public boolean next() throws SQLException {
-    String row_str;
+    String row_str = "";
     try {
       row_str = (String)client.fetchOne();
       if (!row_str.equals("")) {
@@ -992,7 +992,7 @@
       throw new SQLException("Error retrieving next row");
     }
     // NOTE: fetchOne dosn't throw new SQLException("Method not supported").
-    return row_str != "";
+    return !row_str.equals("");
   }
 
   /* (non-Javadoc)

Modified: hadoop/hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java?rev=762900&r1=762899&r2=762900&view=diff
==============================================================================
--- hadoop/hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java (original)
+++ hadoop/hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java Tue Apr
 7 18:44:32 2009
@@ -104,7 +104,8 @@
     assertNotNull("ResultSet is null", res);
     int i = 0;
 
-    while (res.next()) {
+    boolean moreRow = res.next();
+    while (moreRow) {
       try {
         i++;
         res.getString(2);
@@ -114,6 +115,7 @@
 //      System.out.println(res.getString(2));
 //      System.out.println(res.getString(1));
 //      System.out.println(res.getInt(1));
+        moreRow = res.next();
       }
       catch (SQLException e) {
         System.out.println(e.toString());
@@ -123,5 +125,8 @@
     }
     // supposed to get 500 rows
     assertEquals(500, i);
+
+    // should have no more rows
+    assertEquals(false, moreRow);
   }
 }



Mime
View raw message