【问题标题】:Apache spark 2.2.0 Not able to connect to metastore after upgrading hive metastoreApache spark 2.2.0 升级配置单元元存储后无法连接到元存储
【发布时间】:2018-07-09 10:09:39
【问题描述】:

运行 spark-shell 时出现以下错误

Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
18/01/30 18:22:27 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
18/01/30 18:22:29 WARN Utils: Service 'SparkUI' could not bind on port 4040. Attempting port 4041.
18/01/30 18:22:29 WARN Utils: Service 'SparkUI' could not bind on port 4041. Attempting port 4042.

    java.lang.IllegalArgumentException: Error while instantiating 'org.apache.spark.sql.hive.HiveSessionStateBuilder':

    Caused by: scala.MatchError: 2.3.0 (of class java.lang.String)
    at 

org.apache.spark.sql.hive.client.IsolatedClientLoader$.hiveVersion(IsolatedClientLoader.scala:89)
at org.apache.spark.sql.hive.HiveUtils$.newClientForMetadata(HiveUtils.scala:279)
at org.apache.spark.sql.hive.HiveUtils$.newClientForMetadata(HiveUtils.scala:266)
at org.apache.spark.sql.hive.HiveExternalCatalog.client$lzycompute(HiveExternalCatalog.scala:66)
at org.apache.spark.sql.hive.HiveExternalCatalog.client(HiveExternalCatalog.scala:65)
at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$databaseExists$1.apply$mcZ$sp(HiveExternalCatalog.scala:194)
at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$databaseExists$1.apply(HiveExternalCatalog.scala:194)
at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$databaseExists$1.apply(HiveExternalCatalog.scala:194)
at org.apache.spark.sql.hive.HiveExternalCatalog.withClient(HiveExternalCatalog.scala:97)
at org.apache.spark.sql.hive.HiveExternalCatalog.databaseExists(HiveExternalCatalog.scala:193)
at org.apache.spark.sql.internal.SharedState.externalCatalog$lzycompute(SharedState.scala:105)
at org.apache.spark.sql.internal.SharedState.externalCatalog(SharedState.scala:93)
at org.apache.spark.sql.hive.HiveSessionStateBuilder.externalCatalog(HiveSessionStateBuilder.scala:39)
at org.apache.spark.sql.hive.HiveSessionStateBuilder.catalog$lzycompute(HiveSessionStateBuilder.scala:54)
at org.apache.spark.sql.hive.HiveSessionStateBuilder.catalog(HiveSessionStateBuilder.scala:52)
at org.apache.spark.sql.hive.HiveSessionStateBuilder.catalog(HiveSessionStateBuilder.scala:35)
at org.apache.spark.sql.internal.BaseSessionStateBuilder.build(BaseSessionStateBuilder.scala:289)
at org.apache.spark.sql.SparkSession$.org$apache$spark$sql$SparkSession$$instantiateSessionState(SparkSession.scala:1050)
... 61 more
<console>:14: error: not found: value spark
import spark.implicits._
^
<console>:14: error: not found: value spark
import spark.sql
^

【问题讨论】:

    标签: apache-spark hive hive-metastore


    【解决方案1】:

    今天(Spark 2.3.0 RC)支持的最新版本是 2.1。 Relevant code:

    def hiveVersion(version: String): HiveVersion = version match {
      case "12" | "0.12" | "0.12.0" => hive.v12
      case "13" | "0.13" | "0.13.0" | "0.13.1" => hive.v13
      case "14" | "0.14" | "0.14.0" => hive.v14
      case "1.0" | "1.0.0" => hive.v1_0
      case "1.1" | "1.1.0" => hive.v1_1
      case "1.2" | "1.2.0" | "1.2.1" | "1.2.2" => hive.v1_2
      case "2.0" | "2.0.0" | "2.0.1" => hive.v2_0
      case "2.1" | "2.1.0" | "2.1.1" => hive.v2_1
    }
    

    不支持 Hive 2.3。

    【讨论】:

    • 所以 apache hive 2.3.2 不支持 apache spark 2.2.0 ? apache hadoop、apache hive、apache spark 是否有可用的版本匹配表?我需要在 spark 上运行 hive,我应该使用哪些最新版本?cwiki.apache.org/confluence/display/Hive/…
    • 我没见过,但是代码应该是权威的2.2是一样的所以Hive 2.1是支持的最高版本。
    • 谢谢,所以我打算下载 apache spark 2.0、apache hive 2.1 的预构建版本并在 spark 上配置 hive。我的版本是 Hadoop -2.8 , hive -2.1 , spark -2.0 ,zeppelin -0.7.3 。还有什么?
    猜你喜欢
    • 1970-01-01
    • 2017-09-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    相关资源
    最近更新 更多