[
https://issues.apache.org/jira/browse/HIVE-21421?focusedWorklogId=211188&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-211188
]
ASF GitHub Bot logged work on HIVE-21421:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 11/Mar/19 17:54
Start Date: 11/Mar/19 17:54
Worklog Time Spent: 10m
Work Description: maheshk114 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_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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 211188)
Time Spent: 20m (was: 10m)
> 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
>
> Time Spent: 20m
> 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)