scala - 未能获得数据库默认返回 NoSuchObjectException

标签 scala apache-spark hive apache-spark-sql

当我启动 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/

相关文章:

scala - 前向引用 - 为什么这段代码可以编译?

hadoop - Cassandra/HDFS 和 Spark 中的数据移动

apache-spark - SPARK 读取 SEQUENCE 文件

sql - SQL:通过删除左右字符来获取子字符串

hadoop - 在 hive 中连接两个表

scala - 如何在 Akka HTTP 指令中使用 Future?

java - 如何在java文件中运行scala jar文件?

sql - SparkSQL 是 RDBMS 还是 NOSQL?

scala - 在能够处理其他一些消息之前初始化一个actor

java - SPARK:java.lang.IllegalStateException:找不到任何构建目录