[MINOR] fix get classname for hive sync (#2008)
This commit is contained in:
@@ -99,9 +99,23 @@ public class HoodieInputFormatUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static String getInputFormatClassName(HoodieFileFormat baseFileFormat, boolean realtime, Configuration conf) {
|
||||
FileInputFormat inputFormat = getInputFormat(baseFileFormat, realtime, conf);
|
||||
return inputFormat.getClass().getName();
|
||||
public static String getInputFormatClassName(HoodieFileFormat baseFileFormat, boolean realtime) {
|
||||
switch (baseFileFormat) {
|
||||
case PARQUET:
|
||||
if (realtime) {
|
||||
return HoodieParquetRealtimeInputFormat.class.getName();
|
||||
} else {
|
||||
return HoodieParquetInputFormat.class.getName();
|
||||
}
|
||||
case HFILE:
|
||||
if (realtime) {
|
||||
return HoodieHFileRealtimeInputFormat.class.getName();
|
||||
} else {
|
||||
return HoodieHFileInputFormat.class.getName();
|
||||
}
|
||||
default:
|
||||
throw new HoodieIOException("Hoodie InputFormat not implemented for base file format " + baseFileFormat);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getOutputFormatClassName(HoodieFileFormat baseFileFormat) {
|
||||
|
||||
@@ -157,8 +157,7 @@ public class HiveSyncTool extends AbstractSyncTool {
|
||||
if (!tableExists) {
|
||||
LOG.info("Hive table " + tableName + " is not found. Creating it");
|
||||
HoodieFileFormat baseFileFormat = HoodieFileFormat.valueOf(cfg.baseFileFormat.toUpperCase());
|
||||
String inputFormatClassName = HoodieInputFormatUtils.getInputFormatClassName(baseFileFormat, useRealTimeInputFormat,
|
||||
new Configuration());
|
||||
String inputFormatClassName = HoodieInputFormatUtils.getInputFormatClassName(baseFileFormat, useRealTimeInputFormat);
|
||||
|
||||
if (baseFileFormat.equals(HoodieFileFormat.PARQUET) && cfg.usePreApacheInputFormat) {
|
||||
// Parquet input format had an InputFormat class visible under the old naming scheme.
|
||||
|
||||
Reference in New Issue
Block a user