[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) {
|
public static String getInputFormatClassName(HoodieFileFormat baseFileFormat, boolean realtime) {
|
||||||
FileInputFormat inputFormat = getInputFormat(baseFileFormat, realtime, conf);
|
switch (baseFileFormat) {
|
||||||
return inputFormat.getClass().getName();
|
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) {
|
public static String getOutputFormatClassName(HoodieFileFormat baseFileFormat) {
|
||||||
|
|||||||
@@ -157,8 +157,7 @@ public class HiveSyncTool extends AbstractSyncTool {
|
|||||||
if (!tableExists) {
|
if (!tableExists) {
|
||||||
LOG.info("Hive table " + tableName + " is not found. Creating it");
|
LOG.info("Hive table " + tableName + " is not found. Creating it");
|
||||||
HoodieFileFormat baseFileFormat = HoodieFileFormat.valueOf(cfg.baseFileFormat.toUpperCase());
|
HoodieFileFormat baseFileFormat = HoodieFileFormat.valueOf(cfg.baseFileFormat.toUpperCase());
|
||||||
String inputFormatClassName = HoodieInputFormatUtils.getInputFormatClassName(baseFileFormat, useRealTimeInputFormat,
|
String inputFormatClassName = HoodieInputFormatUtils.getInputFormatClassName(baseFileFormat, useRealTimeInputFormat);
|
||||||
new Configuration());
|
|
||||||
|
|
||||||
if (baseFileFormat.equals(HoodieFileFormat.PARQUET) && cfg.usePreApacheInputFormat) {
|
if (baseFileFormat.equals(HoodieFileFormat.PARQUET) && cfg.usePreApacheInputFormat) {
|
||||||
// Parquet input format had an InputFormat class visible under the old naming scheme.
|
// Parquet input format had an InputFormat class visible under the old naming scheme.
|
||||||
|
|||||||
Reference in New Issue
Block a user