Index: ql/src/java/org/apache/hadoop/hive/ql/parse/FileSinkProcessor.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/FileSinkProcessor.java (revision 1573083) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/FileSinkProcessor.java (working copy) @@ -51,7 +51,7 @@ GenTezProcContext context = (GenTezProcContext) procCtx; FileSinkOperator fileSink = (FileSinkOperator) nd; - + // just remember it for later processing context.fileSinkSet.add(fileSink); return true; Index: ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java (revision 1573083) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java (working copy) @@ -146,8 +146,8 @@ } // this method's main use is to help unit testing this class - protected void setupMapWork(MapWork mapWork, GenTezProcContext context, - PrunedPartitionList partitions, Operator root, + protected void setupMapWork(MapWork mapWork, GenTezProcContext context, + PrunedPartitionList partitions, Operator root, String alias) throws SemanticException { // All the setup is done in GenMapRedUtils GenMapRedUtils.setMapWork(mapWork, context.parseContext, @@ -155,12 +155,12 @@ } // removes any union operator and clones the plan - public void removeUnionOperators(Configuration conf, GenTezProcContext context, - BaseWork work) + public void removeUnionOperators(Configuration conf, GenTezProcContext context, + BaseWork work) throws SemanticException { Set> roots = work.getAllRootOperators(); - + // need to clone the plan. Set> newRoots = Utilities.cloneOperatorTree(conf, roots); @@ -185,7 +185,7 @@ if (current instanceof FileSinkOperator) { FileSinkOperator fileSink = (FileSinkOperator)current; - + // remember it for additional processing later context.fileSinkSet.add(fileSink); @@ -192,7 +192,7 @@ FileSinkDesc desc = fileSink.getConf(); Path path = desc.getDirName(); List linked; - + if (!context.linkedFileSinks.containsKey(path)) { linked = new ArrayList(); context.linkedFileSinks.put(path, linked); @@ -203,7 +203,7 @@ desc.setDirName(new Path(path, ""+linked.size())); desc.setLinkedFileSinkDesc(linked); } - + if (current instanceof UnionOperator) { Operator parent = null; int count = 0; @@ -214,7 +214,7 @@ parent = op; } } - + // we should have been able to reach the union from only one side. assert count <= 1; @@ -232,7 +232,7 @@ } else { operators.addAll(current.getChildOperators()); } - } + } work.replaceRoots(replacementMap); } @@ -240,11 +240,11 @@ throws SemanticException { ParseContext parseContext = context.parseContext; - + boolean isInsertTable = // is INSERT OVERWRITE TABLE GenMapRedUtils.isInsertInto(parseContext, fileSink); HiveConf hconf = parseContext.getConf(); - + boolean chDir = GenMapRedUtils.isMergeRequired(context.moveTask, hconf, fileSink, context.currentTask, isInsertTable);