public static String getStoreType(String fileFormat) {
Preconditions.checkNotNull(fileFormat);
String[] fileFormatArrary = fileFormat.split("\\.");
if(fileFormatArrary.length < 1) {
throw new CatalogException("Hive file output format is wrong. - file output format:" + fileFormat);
}
String outputFormatClass = fileFormatArrary[fileFormatArrary.length-1];
if(outputFormatClass.equals(HiveIgnoreKeyTextOutputFormat.class.getSimpleName())) {
return CatalogProtos.StoreType.CSV.name();
} else if(outputFormatClass.equals(HiveSequenceFileOutputFormat.class.getSimpleName())) {
return CatalogProtos.StoreType.SEQUENCEFILE.name();
} else if(outputFormatClass.equals(RCFileOutputFormat.class.getSimpleName())) {
return CatalogProtos.StoreType.RCFILE.name();
} else {
throw new CatalogException("Not supported file output format. - file output format:" + fileFormat);
}
}