Caused by: java.lang.ClassNotFoundException: Class org.openx.data.jsonserde.JsonSerDe not found

解决方法,参考:https://blog.csdn.net/weixin_40775554/article/details/102808656

临时生效

向Hive中导入json jar包:把jar包放入$HIVE_HOME/lib/ 目录下(或其他目录中),在hive cli中执行
hive>add jar jar包的存放路径 ,例如:

hive> add jar $HIVE_HOME/lib/json-serde-1.3-jar-with-dependencies.jar;(临时生效)

或者在hive-site.xml中添加属性:配置

永久生效

<property>
<name>hive.aux.jars.path</name>
<value>file:///export/servers/hive-1.1.0-cdh5.14.0/lib/json-serde-1.3.8-jar-with-dependencies.jar</value>
</property>

注意:还要添加一个属性配置是将压缩设置为false

<property>
<name>hive.exec.compress.output</name>
<value>false</value>
</property>

还要向Hadoop中导入json jar包:直接把jar包放在$HADOOP_HOME/share/hadoop/mapreduce/下即可,注意:一定要放到这个目录中。

Copyright © 2024 MissRong
Powered by .NET 9.0 on Kubernetes