hive建表时使用JsonSerDe报Cannot Validate serde:org.openx.data.jsonserde.JsonSerDe
有两种解决方法
方法一
1. 先检查有没有需要的jar包
2.输入add jar /opt/modules/json-serde-1.3.8-jar-with-dependencies.jar;加载jar包
上述为临时使用,永久使用需要在.hiverc中配置启动hive时修改的设置,让hive在启动时就加载这个jar包
图片中是加载hdfs上的jar包
本地jar包使用
add jar /opt/modules/json-serde-1.3.8-jar-with-dependencies.jar;
3.重启metastore和hiveserver2,可以正常使用
4.如果还不可以正常使用,去看一下hive/conf中的hive-site.xml中{hive.session.id}中hive是大写还是小写,如果不是小写,全部改为小写。
方法二
1.将需要用的jar包放入/opt/install/hive/lib中
2.在配置文件hive/conf中的hive-site.xml中添加
<property>
<name>hive.aux.jars.path</name>
<value>/opt/installs/hive/lib/</value>
</property>
3.重新启动metastore和hiveserver2,即可正常使用
4.如果还不可以正常使用,去看一下hive/conf中的hive-site.xml中{hive.session.id}中hive是大写还是小写,如果不是小写,全部改为小写。