diff --git jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java index c2d0c9d..287176d 100644 --- jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java +++ jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java @@ -29,6 +29,8 @@ import java.util.Map; import java.util.concurrent.locks.ReentrantLock; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.hive.service.cli.RowSet; import org.apache.hive.service.cli.RowSetFactory; import org.apache.hive.service.cli.thrift.TCLIService; @@ -51,6 +53,7 @@ * */ public class HiveStatement implements java.sql.Statement { + public static final Log LOG = LogFactory.getLog(HiveStatement.class.getName()); private final HiveConnection connection; private TCLIService.Iface client; private TOperationHandle stmtHandle = null; @@ -736,7 +739,15 @@ public void setPoolable(boolean poolable) throws SQLException { @Override public void setQueryTimeout(int seconds) throws SQLException { - throw new SQLException("Method not supported"); + if (seconds < 0) { + // invalid timeout + throw new SQLException("Query timeout seconds should be >=0"); + } else if (seconds > 0) { + // We don't support timeout, so no effect + LOG.warn("setQueryTimeout method is not supported"); + } else { + // 0 is supported which means "no limit" + } } /*