[ 
https://issues.apache.org/jira/browse/HIVE-13286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15200337#comment-15200337
 ] 

Vikram Dixit K commented on HIVE-13286:
---------------------------------------

Actually this is what you need:

{code}
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java 
b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
index 7327a42..fc10242 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
@@ -402,14 +402,9 @@ public int compile(String command, boolean resetTaskIds) {
       TaskFactory.resetId();
     }
     saveSession(queryState);
+    String queryId = QueryPlan.makeQueryId();

-    // Generate new query id if it's not set for CLI case. If it's session 
based,
-    // query id is passed in from the client or initialized when the session 
starts.
-    String queryId = conf.getVar(HiveConf.ConfVars.HIVEQUERYID);
-    if (queryId == null || queryId.isEmpty()) {
-      queryId = QueryPlan.makeQueryId();
-      conf.setVar(HiveConf.ConfVars.HIVEQUERYID, queryId);
-    }
+    conf.setVar(HiveConf.ConfVars.HIVEQUERYID, queryId);

     //save some info for webUI for use after plan is freed
     this.queryDisplay.setQueryStr(queryStr);
{code}

> Query ID is being reused across queries
> ---------------------------------------
>
>                 Key: HIVE-13286
>                 URL: https://issues.apache.org/jira/browse/HIVE-13286
>             Project: Hive
>          Issue Type: Bug
>          Components: Parser
>    Affects Versions: 2.0.0
>            Reporter: Vikram Dixit K
>            Assignee: Aihua Xu
>            Priority: Critical
>         Attachments: HIVE-13286.1.patch, HIVE-13286.2.patch
>
>
> [~aihuaxu] I see this commit made via HIVE-11488. I see that query id is 
> being reused across queries. This defeats the purpose of a query id. I am not 
> sure what the purpose of the change in that jira is but it breaks the 
> assumption about a query id being unique for each query. Please take a look 
> into this at the earliest.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to