当我启动 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)
它工作正常吗?
最佳答案
BoneCP 是一个 Java JDBC 连接池,它尝试绑定(bind)到 JDBC 连接,这就是您收到这些警告的原因。您可以通过配置记录器级别来抑制此类警告。
关于scala - 未能获得数据库默认返回 NoSuchObjectException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36386446/