You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2013/04/24 22:25:06 UTC
svn commit: r1471641 -
/hive/branches/branch-0.11/ql/src/java/org/apache/hadoop/hive/ql/exec/MapJoinOperator.java
Author: hashutosh
Date: Wed Apr 24 20:25:06 2013
New Revision: 1471641
URL: http://svn.apache.org/r1471641
Log:
HIVE-4105 : Hive MapJoinOperator unnecessarily deserializes values for all join-keys (Vinod KV via Ashutosh Chauhan)
Modified:
hive/branches/branch-0.11/ql/src/java/org/apache/hadoop/hive/ql/exec/MapJoinOperator.java
Modified: hive/branches/branch-0.11/ql/src/java/org/apache/hadoop/hive/ql/exec/MapJoinOperator.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.11/ql/src/java/org/apache/hadoop/hive/ql/exec/MapJoinOperator.java?rev=1471641&r1=1471640&r2=1471641&view=diff
==============================================================================
--- hive/branches/branch-0.11/ql/src/java/org/apache/hadoop/hive/ql/exec/MapJoinOperator.java (original)
+++ hive/branches/branch-0.11/ql/src/java/org/apache/hadoop/hive/ql/exec/MapJoinOperator.java Wed Apr 24 20:25:06 2013
@@ -230,11 +230,8 @@ public class MapJoinOperator extends Abs
// compute keys and values as StandardObjects
AbstractMapJoinKey key = JoinUtil.computeMapJoinKeys(row, joinKeys[alias],
joinKeysObjectInspectors[alias]);
- ArrayList<Object> value = getFilteredValue(alias, row);
-
- // Add the value to the ArrayList
- storage[alias].add(value);
+ boolean joinNeeded = false;
for (byte pos = 0; pos < order.length; pos++) {
if (pos != alias) {
@@ -243,12 +240,14 @@ public class MapJoinOperator extends Abs
// there is no join-value or join-key has all null elements
if (o == null || key.hasAnyNulls(nullsafes)) {
- if (noOuterJoin) {
- storage[pos] = emptyList;
- } else {
+ if (!noOuterJoin) {
+ joinNeeded = true;
storage[pos] = dummyObjVectors[pos];
+ } else {
+ storage[pos] = emptyList;
}
} else {
+ joinNeeded = true;
rowContainer.reset(o.getObj());
storage[pos] = rowContainer;
aliasFilterTags[pos] = o.getAliasFilter();
@@ -256,8 +255,15 @@ public class MapJoinOperator extends Abs
}
}
- // generate the output records
- checkAndGenObject();
+ if (joinNeeded) {
+ ArrayList<Object> value = getFilteredValue(alias, row);
+
+ // Add the value to the ArrayList
+ storage[alias].add(value);
+
+ // generate the output records
+ checkAndGenObject();
+ }
// done with the row
storage[tag].clear();