You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by th...@apache.org on 2014/08/22 20:37:19 UTC
svn commit: r1619893 - in /hive/trunk:
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java
jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java
Author: thejas
Date: Fri Aug 22 18:37:18 2014
New Revision: 1619893
URL: http://svn.apache.org/r1619893
Log:
HIVE-7680 : Do not throw SQLException for HiveStatement getMoreResults and setEscapeProcessing(false) (Alexander Pivovarov via Thejas Nair)
Modified:
hive/trunk/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java
hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java
Modified: hive/trunk/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java
URL: http://svn.apache.org/viewvc/hive/trunk/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java?rev=1619893&r1=1619892&r2=1619893&view=diff
==============================================================================
--- hive/trunk/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java (original)
+++ hive/trunk/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java Fri Aug 22 18:37:18 2014
@@ -868,7 +868,7 @@ public class TestJdbcDriver2 {
assertNotNull("ResultSet is null", res);
assertTrue("getResultSet() not returning expected ResultSet", res == stmt
.getResultSet());
- assertEquals("get update count not as expected", 0, stmt.getUpdateCount());
+ assertEquals("get update count not as expected", -1, stmt.getUpdateCount());
int i = 0;
ResultSetMetaData meta = res.getMetaData();
Modified: hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java?rev=1619893&r1=1619892&r2=1619893&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java Fri Aug 22 18:37:18 2014
@@ -21,6 +21,7 @@ package org.apache.hive.jdbc;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import java.sql.SQLWarning;
import java.util.HashMap;
import java.util.Map;
@@ -435,7 +436,7 @@ public class HiveStatement implements ja
@Override
public ResultSet getGeneratedKeys() throws SQLException {
- throw new SQLException("Method not supported");
+ throw new SQLFeatureNotSupportedException("Method not supported");
}
/*
@@ -469,7 +470,7 @@ public class HiveStatement implements ja
@Override
public boolean getMoreResults() throws SQLException {
- throw new SQLException("Method not supported");
+ return false;
}
/*
@@ -480,7 +481,7 @@ public class HiveStatement implements ja
@Override
public boolean getMoreResults(int current) throws SQLException {
- throw new SQLException("Method not supported");
+ throw new SQLFeatureNotSupportedException("Method not supported");
}
/*
@@ -550,7 +551,7 @@ public class HiveStatement implements ja
@Override
public int getUpdateCount() throws SQLException {
checkConnection("getUpdateCount");
- return 0;
+ return -1;
}
/*
@@ -600,7 +601,7 @@ public class HiveStatement implements ja
@Override
public void setCursorName(String name) throws SQLException {
- throw new SQLException("Method not supported");
+ throw new SQLFeatureNotSupportedException("Method not supported");
}
/*
@@ -611,7 +612,9 @@ public class HiveStatement implements ja
@Override
public void setEscapeProcessing(boolean enable) throws SQLException {
- throw new SQLException("Method not supported");
+ if (enable) {
+ throw new SQLException("Method not supported");
+ }
}
/*