【问题标题】:Error in importing hive packages导入 hive 包时出错
【发布时间】: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 hive udf


【解决方案1】:

在 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

【讨论】:

    猜你喜欢
    • 2012-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-19
    • 2016-07-31
    • 1970-01-01
    • 2017-08-21
    • 2016-05-23
    相关资源
    最近更新 更多