You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by GitBox <gi...@apache.org> on 2019/03/11 17:54:06 UTC

[GitHub] [hive] maheshk114 commented on a change in pull request #562: HIVE-21421: HiveStatement.getQueryId throws NPE when query is not running.

maheshk114 commented on a change in pull request #562: HIVE-21421: HiveStatement.getQueryId throws NPE when query is not running.
URL: https://github.com/apache/hive/pull/562#discussion_r264355254
 
 

 ##########
 File path: jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java
 ##########
 @@ -1007,8 +1007,17 @@ public void setInPlaceUpdateStream(InPlaceUpdateStream stream) {
     this.inPlaceUpdateStream = stream;
   }
 
-  @VisibleForTesting
+  /**
+   * Returns the Query ID if it is running.
+   * This method is a public API for usage outside of Hive, although it is not part of the
+   * interface java.sql.Statement.
+   * @return Valid query ID if it is running else returns NULL.
+   * @throws SQLException If any internal failures.
+   */
   public String getQueryId() throws SQLException {
+    if (stmtHandle == null) {
+      return null;
 
 Review comment:
   what about concurrent closure of statement ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services