diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskRunnerCallable.java b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskRunnerCallable.java index 9cd5455939c2..aab6ac6600a8 100644 --- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskRunnerCallable.java +++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskRunnerCallable.java @@ -318,9 +318,18 @@ public LlapTaskUmbilicalProtocol run() throws Exception { private void setMDCFromNDC() { final Stack clonedNDC = NDC.cloneStack(); - final String fragId = clonedNDC.pop(); - final String queryId = clonedNDC.pop(); - final String dagId = clonedNDC.pop(); + if(!clonedNDC.empty()) + LOG.debug("Get the class name " + clonedNDC.peek().getClass()); + + final String fragId = clonedNDC.empty() ? "":clonedNDC.pop().toString(); + LOG.debug("FragId " + fragId); + + final String queryId = clonedNDC.empty() ? "":clonedNDC.pop().toString(); + LOG.debug("queryId " + queryId); + + final String dagId = clonedNDC.empty() ? "":clonedNDC.pop().toString(); + LOG.debug("dagId " + dagId); + MDC.put("dagId", dagId); MDC.put("queryId", queryId); MDC.put("fragmentId", fragId);