scala – 无法获取数据库缺省值返回NoSuchObjectException

当我开始火花时,我得到这个警告:

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)是否正常工作?

最佳答案 BoneCP是一个Java JDBC连接池,它尝试绑定到JDBC连接,这就是您收到这些警告的原因.您可以通过配置记录器级别来抑制此类警告.

点赞