Index: ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java (revision 750536) +++ ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java (working copy) @@ -61,7 +61,6 @@ // Task Hash Map private HashMap taskInfoMap = new HashMap(); - private HashMap rowCountMap = new HashMap(); private static final String DELIMITER = " "; @@ -164,6 +163,7 @@ public static class QueryInfo extends Info { public Map hm = new HashMap(); + public Map rowCountMap = new HashMap(); }; public static class TaskInfo extends Info { @@ -307,6 +307,7 @@ */ public void setTaskCounters(String queryId, String taskId, RunningJob rj) { String id = queryId + ":" + taskId; + QueryInfo ji = queryInfoMap.get(queryId); StringBuilder sb1 = new StringBuilder(""); TaskInfo ti = taskInfoMap.get(id); if (ti == null) @@ -334,7 +335,7 @@ sb1.append(tab); sb1.append('~'); sb1.append(counter.getCounter()); - rowCountMap.put(tab, counter.getCounter()); + ji.rowCountMap.put(tab, counter.getCounter()); } @@ -355,9 +356,10 @@ taskInfoMap.get(id).hm.put(Keys.TASK_COUNTERS.name(), sb.toString()); } - public void printRowCount(){ - for (String tab: rowCountMap.keySet()){ - console.printInfo(rowCountMap.get(tab)+" Rows loaded to "+ tab); + public void printRowCount(String queryId){ + QueryInfo ji = queryInfoMap.get(queryId); + for (String tab: ji.rowCountMap.keySet()){ + console.printInfo(ji.rowCountMap.get(tab)+" Rows loaded to "+ tab); } } /** Index: ql/src/java/org/apache/hadoop/hive/ql/Driver.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/Driver.java (revision 750536) +++ ql/src/java/org/apache/hadoop/hive/ql/Driver.java (working copy) @@ -267,7 +267,7 @@ if (SessionState.get() != null){ SessionState.get().getHiveHistory().setQueryProperty(queryId, Keys.QUERY_RET_CODE, String.valueOf(0)); - SessionState.get().getHiveHistory().printRowCount(); + SessionState.get().getHiveHistory().printRowCount(queryId); } } catch (SemanticException e) { if (SessionState.get() != null)