[
https://issues.apache.org/jira/browse/HIVE-26167?focusedWorklogId=762150&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-762150
]
ASF GitHub Bot logged work on HIVE-26167:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Apr/22 07:19
Start Date: 26/Apr/22 07:19
Worklog Time Spent: 10m
Work Description: lcspinter commented on code in PR #3234:
URL: https://github.com/apache/hive/pull/3234#discussion_r858364612
##########
ql/src/java/org/apache/hadoop/hive/ql/Driver.java:
##########
@@ -532,6 +522,10 @@ private void prepareContext() throws
CommandProcessorException {
context.setHDFSCleanup(true);
driverTxnHandler.setContext(context);
+
+ if (SessionState.get() != null) {
+
SessionState.get().addQueryState(getConf().get(HiveConf.ConfVars.HIVEQUERYID.varname),
getQueryState());
Review Comment:
I think there is no difference in terms of performance, but I changed it for
the sake of readability.
Issue Time Tracking
-------------------
Worklog Id: (was: 762150)
Time Spent: 50m (was: 40m)
> QueryStateMap in SessionState is not maintained correctly
> ---------------------------------------------------------
>
> Key: HIVE-26167
> URL: https://issues.apache.org/jira/browse/HIVE-26167
> Project: Hive
> Issue Type: Improvement
> Reporter: László Pintér
> Assignee: László Pintér
> Priority: Major
> Labels: pull-request-available
> Time Spent: 50m
> Remaining Estimate: 0h
>
> When the Driver is the QueryStateMap is also initialized with the query ID
> and the current queryState object. This record is kept in the map until the
> execution of the query is completed.
> There are many unit tests that initialise the driver object once during the
> setup phase, and use the same object to execute all the different queries. As
> a consequence, after the first execution, the QueryStateMap will be cleaned
> and all subsequent queries will run into null pointer exception while trying
> to fetch the current querystate from the SessionState.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)