解决原文链接:
https://blog.csdn.net/u014804456/article/details/77747720
githup地址:https://github.com/apache/hive/blob/master/metastore/scripts/upgrade/mssql/upgrade-2.2.0-to-2.3.0.mssql.sql

故障描述如下:
spark和hive整合之后,spark-sql可以使用,hive直接进入会保错,保错信息如下
Logging initialized using configuration in jar:file:/home/hadoop/hdfs/hive/lib/hive-common-2.3.4.jar!/hive-log4j2.properties Async: true
Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
hive> show tables;
FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
hive整合spark之后进入hive报错_第1张图片hive整合spark之后进入hive报错_第2张图片

进入存储元数据的数据库,本地库位mysql
MariaDB [(none)]> use metastore;
更新以下内容

MariaDB [metastore]> SELECT 'Upgrading MetaStore schema from 2.2.0 to 2.3.0' AS MESSAGE;
+------------------------------------------------+
| MESSAGE                                        |
+------------------------------------------------+
| Upgrading MetaStore schema from 2.2.0 to 2.3.0 |
+------------------------------------------------+
1 row in set (0.00 sec)

MariaDB [metastore]> UPDATE VERSION SET SCHEMA_VERSION='2.3.0', VERSION_COMMENT='Hive release version 2.3.0' where VER_ID=1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [metastore]> SELECT 'Finished upgrading MetaStore schema from 2.2.0 to 2.3.0' AS MESSAGE;
+---------------------------------------------------------+
| MESSAGE                                                 |
+---------------------------------------------------------+
| Finished upgrading MetaStore schema from 2.2.0 to 2.3.0 |
+---------------------------------------------------------+
1 row in set (0.00 sec)

MariaDB [metastore]> exit;
Bye

再次通过hive进入hive命令行界面进行测试
hive整合spark之后进入hive报错_第3张图片
问题完美解决