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 1ec71ea6cd..c93124b0e5 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java @@ -1482,14 +1482,16 @@ public int execute() throws CommandNeedRetryException { boolean noName = StringUtils.isEmpty(conf.get(MRJobConfig.JOB_NAME)); int maxlen = conf.getIntVar(HiveConf.ConfVars.HIVEJOBNAMELENGTH); - String queryId = plan.getQueryId(); - // Get the query string from the conf file as the compileInternal() method might - // hide sensitive information during query redaction. - String queryStr = HiveConf.getVar(conf, HiveConf.ConfVars.HIVEQUERYSTRING); + String queryId = ""; + String queryStr = ""; maxthreads = HiveConf.getIntVar(conf, HiveConf.ConfVars.EXECPARALLETHREADNUMBER); try { + queryId = plan.getQueryId(); + // Get the query string from the conf file as the compileInternal() method might + // hide sensitive information during query redaction. + queryStr = HiveConf.getVar(conf, HiveConf.ConfVars.HIVEQUERYSTRING); LOG.info("Executing command(queryId=" + queryId + "): " + queryStr); // compile and execute can get called from different threads in case of HS2 // so clear timing in this thread's Hive object before proceeding.