This is an automated email from the ASF dual-hosted git repository. sankarh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push: new ae82715 HIVE-21669: HS2 throws NPE when HiveStatement.getQueryId is invoked and query is closed concurrently (Sankar Hariappan, reviewed by Mahesh Kumar Behera) ae82715 is described below commit ae82715f1014c4ed514441311b61ed1891e2a12b Author: Sankar Hariappan <sank...@apache.org> AuthorDate: Tue Apr 30 17:33:41 2019 +0530 HIVE-21669: HS2 throws NPE when HiveStatement.getQueryId is invoked and query is closed concurrently (Sankar Hariappan, reviewed by Mahesh Kumar Behera) --- jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java | 3 --- .../src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java b/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java index d9b6254..20e9c3c 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 class HiveStatement implements java.sql.Statement { 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 085604b..48f4fe2 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 abstract class ThriftCLIService extends AbstractService implements TCLISe 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); } }