Index: ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java (revision 1167289) +++ ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java (working copy) @@ -86,8 +86,6 @@ private Map, java.util.ArrayList> operatorToPaths; - private final java.util.ArrayList childrenPaths = new ArrayList(); - private ArrayList> extraChildrenToClose = null; private static class MapInputPath { @@ -123,7 +121,10 @@ @Override public int hashCode() { - return (op == null) ? 0 : op.hashCode(); + int ret = (path == null) ? 0 : path.hashCode(); + ret += (alias == null) ? 0 : alias.hashCode(); + ret += (op == null) ? 0 : op.hashCode(); + return ret; } public Operator getOp() { @@ -358,7 +359,6 @@ statsMap.put(Counter.DESERIALIZE_ERRORS, deserialize_error_count); try { - boolean done = false; for (String onefile : conf.getPathToAliases().keySet()) { MapOpCtx opCtx = initObjectInspector(conf, hconf, onefile); Path onepath = new Path(new Path(onefile).toUri().getPath()); @@ -381,12 +381,10 @@ // Operator if (!onepath.toUri().relativize(fpath.toUri()).equals(fpath.toUri())) { children.add(op); - childrenPaths.add(onefile); LOG.info("dump " + op.getName() + " " + opCtxMap.get(inp).getRowObjectInspector().getTypeName()); } setInspectorInput(inp); - done = true; } } @@ -410,8 +408,6 @@ // set that parent initialization is done and call initialize on children state = State.INIT; List> children = getChildOperators(); - Path fpath = new Path((new Path(HiveConf.getVar(hconf, - HiveConf.ConfVars.HADOOPMAPFILENAME))).toUri().getPath()); for (Entry entry : opCtxMap.entrySet()) { // Add alias, table name, and partitions to hadoop conf so that their @@ -432,20 +428,8 @@ extraChildrenToClose.add(op); } - // multiple input paths may corresponding the same operator (tree). The - // below logic is to avoid initialize one operator multiple times if there - // is one input path in this mapper's input paths. - boolean shouldInit = true; - List paths = operatorToPaths.get(op); - for (String path : paths) { - if (childrenPaths.contains(path) && !path.equals(input.path)) { - shouldInit = false; - break; - } - } - if (shouldInit) { - op.initialize(hconf, new ObjectInspector[] {entry.getValue().getRowObjectInspector()}); - } + op.initialize(hconf, new ObjectInspector[] {entry.getValue().getRowObjectInspector()}); + } }