【发布时间】:2016-10-07 06:29:11
【问题描述】:
我是 hive udf 的新手。我已经下载了“apache-hive-2.1.0-bin”并将我的项目的构建路径配置为apache-hive-2.1.0-bin\lib(所有jar)。
import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.Text; // <= I am not able to import this package.
public class replace extends UDF {
private Text result = new Text();
public Text evaluate(String str, String str1, String str2) {
String rep = str.replace(str1, str2);
result.set(rep);
return result;
}
}
【问题讨论】:
-
你需要
hadoop-core.jar-- How do I compile a Hive UDF