导入hive包报错

Error in importing hive packages

我是 hive 的 udf 新手。我已经下载了“apache-hive-2.1.0-bin”并将我的项目的构建路径配置为 apache-hive-2.1.0-bin\lib(所有 jars)。

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;
    }
}

在lib路径hadoop-common-2.2中添加如下内容。0.jar

它将在

中可用
http://central.maven.org/maven2/org/apache/hadoop/hadoop-common/2.2.0/hadoop-common-2.2.0.jar