hudi版本1.0.0
需要使用较低版本的hive,编译hudi只需要修改下类即可:
org.apache.hudi.hadoop.hive.HoodieCombineHiveInputFormat
一、复制org.apache.hadoop.hive.common.StringInternUtils
找个hive2.3.9的源码包,创建包路径,并将此类复制到hudi的hudi-common
到下。
当然其他包(hudi-hadoop-mr
)也可以。HoodieCombineHiveInputFormat
类能读取到就可以。
二、添加方法并修改
基于不同的hive版本,只是有一些方法,中string <—> path 不同,因此添加一些转换对象,将path和string互转即可。如下:
添加方法:
public static <T> Map<Path, T> toPathMap(Map<String, T> input) {
Map<Path, T> output = new HashMap<>();
input.forEach((s, strings) -> {
output.put(new Path(s), strings);
});
return output;
}
public static