获取数据库默认值失败,返回nosuchobjectexception

7bsow1i6  于 2021-06-26  发布在  Hive
关注(0)|答案(3)|浏览(380)

当我启动spark时,我得到以下警告:

Using Scala version 2.10.5 (OpenJDK 64-Bit Server VM, Java 1.8.0_77)
Type in expressions to have them evaluated.
Type :help for more information.
Spark context available as sc.
16/04/03 15:07:31 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
16/04/03 15:07:31 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
16/04/03 15:07:39 WARN ObjectStore: Version information not found in metastore. hive.metastore.schema.verification is not enabled so recording the schema version 1.2.0
16/04/03 15:07:39 WARN ObjectStore: Failed to get database default, returning NoSuchObjectException
SQL context available as sqlContext.

scala>

当我执行这个命令时: var sqlContext = new org.apache.spark.sql.hive.HiveContext(sc) 我再次得到这个警告:

scala> var sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)
16/04/03 15:04:31 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
16/04/03 15:04:31 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
16/04/03 15:04:35 WARN ObjectStore: Failed to get database default, returning NoSuchObjectException
sqlContext: org.apache.spark.sql.hive.HiveContext = org.apache.spark.sql.hive.HiveContext@13453610

所以我的问题是,如果你知道为什么这个警告会发生,如果,尽管警告发生了,命令 var sqlContext = new org.apache.spark.sql.hive.HiveContext(sc) 它工作正常吗?

i86rm4rw

i86rm4rw1#

bonecp是一个javajdbc连接池,它试图绑定到jdbc连接,这就是为什么您会收到这些警告。您可以通过配置记录器级别来抑制此类警告。

pn9klfpd

pn9klfpd2#

我也遇到这样的警告:
获取数据库默认值失败,返回nosuchobjectexception
但我可以正确连接到Hive,所以请检查您的 hive-site.xml 我不确定这个警告是否会影响到哨兵。

nukf8bse

nukf8bse3#

检查是否已分配sqlcontext:

sqlContext = pyspark.SQLContext(sc)

相关问题