sankarh 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_r264537185
 
 

 ##########
 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:
   Fixed.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to