diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/ExecDriver.java ql/src/java/org/apache/hadoop/hive/ql/exec/ExecDriver.java index 4fba845..c19ab96 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/ExecDriver.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/ExecDriver.java @@ -740,12 +740,15 @@ public class ExecDriver extends Task implements Serializable, Hadoop // The input file does not exist, replace it by a empty file Class outFileFormat = null; boolean nonNative = true; + Properties props; if (isEmptyPath) { PartitionDesc partDesc = work.getPathToPartitionInfo().get(path); + props = partDesc.getProperties(); outFileFormat = partDesc.getOutputFileFormatClass(); nonNative = partDesc.getTableDesc().isNonNative(); } else { TableDesc tableDesc = work.getAliasToPartnInfo().get(alias).getTableDesc(); + props = tableDesc.getProperties(); outFileFormat = tableDesc.getOutputFileFormatClass(); nonNative = tableDesc.isNonNative(); } @@ -799,7 +802,7 @@ public class ExecDriver extends Task implements Serializable, Hadoop String onefile = newPath.toString(); RecordWriter recWriter = outFileFormat.newInstance().getHiveRecordWriter(job, newFilePath, - Text.class, false, new Properties(), null); + Text.class, false, props, null); recWriter.close(false); FileInputFormat.addInputPaths(job, onefile); return numEmptyPaths;