Index: ql/src/java/org/apache/hadoop/hive/ql/io/CombineHiveInputFormat.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/io/CombineHiveInputFormat.java (revision 947889) +++ ql/src/java/org/apache/hadoop/hive/ql/io/CombineHiveInputFormat.java (working copy) @@ -72,7 +72,7 @@ */ public static class CombineHiveInputSplit implements InputSplitShim { - static String inputFormatClassName = null; + String inputFormatClassName; InputSplitShim inputSplitShim; public CombineHiveInputSplit() throws IOException { @@ -87,18 +87,17 @@ public CombineHiveInputSplit(JobConf job, InputSplitShim inputSplitShim) throws IOException { this.inputSplitShim = inputSplitShim; - - // get the inputFormatClassName only once because it will be the same - // for all input files within the same input split. - if (job != null && inputFormatClassName == null) { + if (job != null) { Map pathToPartitionInfo = Utilities .getMapRedWork(job).getPathToPartitionInfo(); // extract all the inputFormatClass names for each chunk in the // CombinedSplit. Path[] ipaths = inputSplitShim.getPaths(); - PartitionDesc part = getPartitionDescFromPath(pathToPartitionInfo, ipaths[0]); - inputFormatClassName = part.getInputFileFormatClass().getName(); + if (ipaths.length > 0) { + PartitionDesc part = getPartitionDescFromPath(pathToPartitionInfo, ipaths[0]); + inputFormatClassName = part.getInputFileFormatClass().getName(); + } } }