diff --git a/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java b/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java index d9b625466c..20e9c3c7e0 100644 --- a/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java +++ b/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java @@ -1023,9 +1023,6 @@ public String getQueryId() throws SQLException { return client.GetQueryId(new TGetQueryIdReq(stmtHandle)).getQueryId(); } catch (TException e) { throw new SQLException(e); - } catch (Exception e) { - // If concurrently the query is closed before we fetch queryID. - return null; } } } diff --git a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java index 085604bdac..48f4fe29ec 100644 --- a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java +++ b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java @@ -854,6 +854,9 @@ public TGetQueryIdResp GetQueryId(TGetQueryIdReq req) throws TException { return new TGetQueryIdResp(cliService.getQueryId(req.getOperationHandle())); } catch (HiveSQLException e) { throw new TException(e); + } catch (Exception e) { + // If concurrently the query is closed before we fetch queryID. + return new TGetQueryIdResp((String)null); } }