问题描述:进入hive,执行HQL出现如下错误:
FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
原因:是因为元数据库未初始化
解决办法:
1、在hive-site.xml配置文件里添加如下内容:
<property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
<description>
Enforce metastore schema version consistency.
True: Verify that version information stored in metastore matches with one from Hive jars. Also disable automatic
schema migration attempt. Users are required to manully migrate schema after Hive upgrade which ensures
proper metastore schema migration. (Default)
False: Warn if the version information stored in metastore doesn't match with one from in Hive jars.
</description>
</property>
2、根据使用的元数据库设置相应的数据库(例如mysql)
schematool -initSchema -dbType mysql
版权声明:本文为kuang1521793003原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。