您的位置:首页 > 其它

spark 访问hive表报错

2018-10-25 18:08 399 查看

spark访问hive表: 在spark/conf目录下:引入hive配置文件

ln -sf /soft/hive/conf/hive-site.xml /soft/spark/conf/

错误1:

Hive Schema version 1.2.0 does not match metastore’s schema version 2.3.0
原因: hive版本不一致, 查看hive在mysql中的注册信息如下
解决办法: 降低hive的版本, 修改 SCHEMA_VERSION的值为2.1.1

错误2:

Exception thrown obtaining schema column information from datastore
org.datanucleus.exceptions.NucleusDataStoreException: Exception thrown obtaining schema column information from datastore…
Caused by: java.sql.SQLException: Column name pattern can not be NULL or empty.
原因: 是mysql驱动版本太高,删除后重新导入低版本的驱动


重启spark-shell, 加载hive文件成功!

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: