Index: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
===================================================================
--- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (revision 911060)
+++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (working copy)
@@ -141,6 +141,7 @@
// Default file format for CREATE TABLE statement
// Options: TextFile, SequenceFile
HIVEDEFAULTFILEFORMAT("hive.default.fileformat", "TextFile"),
+ HIVECHECKFILEFORMAT("hive.fileformat.check", true),
//Location of Hive run time structured log file
HIVEHISTORYFILELOC("hive.querylog.location", "/tmp/"+System.getProperty("user.name")),
Index: conf/hive-default.xml
===================================================================
--- conf/hive-default.xml (revision 911563)
+++ conf/hive-default.xml (working copy)
@@ -199,6 +199,12 @@
+ hive.fileformat.check
+ true
+ Whether to check file format or not
+
+
+
hive.map.aggr
true
Whether to use map-side aggregation in Hive Group By queries
Index: ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
===================================================================
--- ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java (revision 903370)
+++ ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java (working copy)
@@ -28,6 +28,7 @@
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.MetaStoreUtils;
import org.apache.hadoop.hive.ql.hooks.WriteEntity;
import org.apache.hadoop.hive.ql.io.HiveFileFormatUtils;
@@ -129,10 +130,14 @@
throw new HiveException("addFiles: filesystem error in check phase", e);
}
- // Check if the file format of the file matches that of the table.
- boolean flag = HiveFileFormatUtils.checkInputFormat(fs, conf, tbd.getTable().getInputFileFormatClass(), files);
- if(!flag)
- throw new HiveException("Wrong file format. Please check the file's format.");
+ if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVECHECKFILEFORMAT)) {
+ // Check if the file format of the file matches that of the table.
+ boolean flag = HiveFileFormatUtils.checkInputFormat(fs, conf, tbd.getTable().getInputFileFormatClass(), files);
+ if (!flag) {
+ throw new HiveException(
+ "Wrong file format. Please check the file's format.");
+ }
+ }
}
if(tbd.getPartitionSpec().size() == 0) {