我读过this question,但是答案对我没有帮助。
我已经使用文件的完整路径添加了必要的jar文件joda-time-2.2.jar
。 Hive中的功能需要此文件。然后尝试在Hive中使用函数时,标题中出现错误。
尽管添加了jar,但我仍然收到错误:
add jar /path/to/the/scripts/joda-time-2.2.jar;
hive> list jars;
/path/te/the/scripts/joda-time-2.2.jar
奇怪的是有时不会发生此错误,因此我可以成功执行该功能。但是,大多数情况下会发生此错误,因此我被错误消息赶出了 hive 。
我尝试了
joda-time-2.2.jar
文件的不同版本,但没有成功。有人能帮我吗?
附言:
我正在使用的库是brickhouse。完整的代码是:
add jar /path/te/the/scripts/brickhouse-0.6.0-sources.jar;
add jar /path/te/the/scripts/joda-time-2.2.jar
CREATE TEMPORARY FUNCTION from_json AS 'brickhouse.udf.json.FromJsonUDF';
select from_json('{"key1":"value1","key2":"value2","key3":"value3","key4":[["0","1","nnn"],["1","3","mmm"],["1","3","ggg"],["1","5","kkk"],["4","5","ppp"]]}', 'map<string,string>') from my_table;
最佳答案
您应该像这样添加 jar :
添加jar /path/te/the/scripts/joda-time-2.2.jar;
添加jar /path/te/the/scripts/brickhouse-0.6.0-sources.jar;
关于java - 在Hive中:线程 “main”中的异常java.lang.NoClassDefFoundError:org/joda/time/format/ISODateTimeFormat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33419866/