Spark访问ive的时候报错,提示:Hive Schema version 1.2.0 does not match metastore's schema version 2.3.0
运行spark写hive数据的时候报错了,提示:
使用的hive版本是2.3.9
Caused by: MetaException(message:Hive Schema version 1.2.0 does not match metastore's schema version 2.3.0 Metastore is not upgraded or corrupt)
at org.apache.hadoop.hive.metastore.ObjectStore.checkSchema(ObjectStore.java:6679)
at org.apache.hadoop.hive.metastore.ObjectStore.verifySchema(ObjectStore.java:6645)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:114)
at com.sun.proxy.$Proxy44.verifySchema(Unknown Source)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:572)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:620)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:461)
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:66)
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:72)
at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:5762)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:199)
at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:74)
... 50 more
使用的hive版本是2.3.9
发布于:8个月前 (01-19) IP属地:四川省
1 个回答
这是由于hive-site.xml文件中默认打开了schema验证,示例如下:
我们把这个验证给关掉即可,即设置为false,服务端的hive-site.xml修改之后重启下hive,spark项目中src/main/resources中添加的hive-site.xml这个值也需要修改为false,然后重新运行就没问题了。
<property>
<name>hive.metastore.schema.verification</name>
<value>true</value>
</property>
我们把这个验证给关掉即可,即设置为false,服务端的hive-site.xml修改之后重启下hive,spark项目中src/main/resources中添加的hive-site.xml这个值也需要修改为false,然后重新运行就没问题了。
发布于:8个月前 (01-19) IP属地:未知
我来回答
您需要 登录 后回答此问题!