hadoop-hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From athu...@apache.org
Subject svn commit: r752743 - in /hadoop/hive/trunk: CHANGES.txt ql/src/java/org/apache/hadoop/hive/ql/Driver.java ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java
Date Thu, 12 Mar 2009 01:40:04 GMT
Author: athusoo
Date: Thu Mar 12 01:40:04 2009
New Revision: 752743

URL: http://svn.apache.org/viewvc?rev=752743&view=rev
Log:
HIVE-327. Fix row counts printed in hive history to reflect the
count of rows from the query in the session. (Suresh Anthony via athusoo)


Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=752743&r1=752742&r2=752743&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Thu Mar 12 01:40:04 2009
@@ -23,6 +23,9 @@
     HIVE-286. Use round(xxx,12) to make sure there is no precision
     matching problem in testCliDriver_udf7. (zshao via johan)    
 
+    HIVE-327. Fix row counts printed in hive history to reflect the
+    count of rows from the query in the session. (Suresh Anthony via athusoo)
+
 Release 0.2.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java?rev=752743&r1=752742&r2=752743&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java Thu Mar 12 01:40:04
2009
@@ -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)

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java?rev=752743&r1=752742&r2=752743&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java Thu Mar
12 01:40:04 2009
@@ -61,7 +61,6 @@
   // Task Hash Map
   private HashMap<String, TaskInfo> taskInfoMap = new HashMap<String, TaskInfo>();
   
-  private HashMap<String, Long> rowCountMap = new HashMap<String, Long>();
 
   private static final String DELIMITER = " ";
 
@@ -164,6 +163,7 @@
 
   public static class QueryInfo extends Info {
     public Map<String, String> hm = new HashMap<String, String>();
+    public Map<String, Long> rowCountMap = new HashMap<String, Long>();
   };
 
   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);
     }
   }
   /**



Mime
View raw message