[ 
https://issues.apache.org/jira/browse/HIVE-21421?focusedWorklogId=211540&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-211540
 ]

ASF GitHub Bot logged work on HIVE-21421:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Mar/19 06:35
            Start Date: 12/Mar/19 06:35
    Worklog Time Spent: 10m 
      Work Description: sankarh commented on 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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 211540)
    Time Spent: 0.5h  (was: 20m)

> HiveStatement.getQueryId throws NPE when query is not running. 
> ---------------------------------------------------------------
>
>                 Key: HIVE-21421
>                 URL: https://issues.apache.org/jira/browse/HIVE-21421
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 4.0.0
>            Reporter: Sankar Hariappan
>            Assignee: Sankar Hariappan
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-21421.01.patch, HIVE-21421.02.patch
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> HiveStatement.getQueryId throws NullPointerException if it invoked without 
> executing any query or query is closed. It should instead return null so that 
> caller would check it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to