You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by sz...@apache.org on 2015/02/12 22:18:25 UTC
svn commit: r1659403 - in /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql:
exec/FileSinkOperator.java history/HiveHistoryImpl.java
Author: szehon
Date: Thu Feb 12 21:18:25 2015
New Revision: 1659403
URL: http://svn.apache.org/r1659403
Log:
HIVE-9023 : HiveHistoryImpl relies on removed counters to print num rows (Naveen Gangam via Szehon)
Modified:
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistoryImpl.java
Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java?rev=1659403&r1=1659402&r2=1659403&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java Thu Feb 12 21:18:25 2015
@@ -418,11 +418,13 @@ public class FileSinkOperator extends Te
numRows = 0;
- String context = jc.get(Operator.CONTEXT_NAME_KEY, "");
- if (context != null && !context.isEmpty()) {
- context = "_" + context.replace(" ","_");
+ String suffix = Integer.toString(conf.getDestTableId());
+ String fullName = conf.getTableInfo().getTableName();
+ if (fullName != null) {
+ suffix = suffix + "_" + fullName.toLowerCase();
}
- statsMap.put(Counter.RECORDS_OUT + context, row_count);
+
+ statsMap.put(Counter.RECORDS_OUT + "_" + suffix, row_count);
initializeChildren(hconf);
} catch (HiveException e) {
Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistoryImpl.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistoryImpl.java?rev=1659403&r1=1659402&r2=1659403&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistoryImpl.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistoryImpl.java Thu Feb 12 21:18:25 2015
@@ -67,7 +67,7 @@ public class HiveHistoryImpl implements
private static final String DELIMITER = " ";
- private static final String ROW_COUNT_PATTERN = "TABLE_ID_(\\d+)_ROWCOUNT";
+ private static final String ROW_COUNT_PATTERN = "RECORDS_OUT_(\\d+)(_)*(\\S+)*";
private static final Pattern rowCountPattern = Pattern.compile(ROW_COUNT_PATTERN);
@@ -343,6 +343,10 @@ public class HiveHistoryImpl implements
if (m.find()) {
String tuple = m.group(1);
+ String tableName = m.group(3);
+ if (tableName != null)
+ return tableName;
+
return idToTableMap.get(tuple);
}
return null;