scala 无法获得数据库默认返回 NoSuchObjectException
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36386446/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
failed to get database default returning NoSuchObjectException
提问by codin
When I start spark I get this warnings:
当我开始 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>
And also when I execute this command: var sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)
而且当我执行这个命令时: var sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)
I get again this warning:
我再次收到此警告:
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
So my question is if you know why this warning is happening and if, although the warning is happening, the command var sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)its working correctly?
所以我的问题是,您是否知道为什么会发生此警告,以及是否尽管发生了警告,但该命令var sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)是否正常工作?
采纳答案by Eugene
BoneCP is a Java JDBC connection pool and it's tries to bind to a JDBC connection and this is why you receive these warnings. You may suppress this kind of warnings by configure the logger level.
BoneCP 是一个 Java JDBC 连接池,它尝试绑定到 JDBC 连接,这就是您收到这些警告的原因。您可以通过配置记录器级别来抑制这种警告。
回答by hu li
I meet this warning,too as :
我也遇到了这个警告:
"Failed to get database default, returning NoSuchObjectException"
“无法获得数据库默认值,返回 NoSuchObjectException”
but i can connect to hive correctly,so check your hive-site.xmland i am not sure if this warning will affect the sentry.
但我可以正确连接到蜂巢,所以检查你的hive-site.xml,我不确定这个警告是否会影响哨兵。
回答by Harish Khollam
Check if you have assigned SQLContext:
检查您是否已分配SQLContext:
sqlContext = pyspark.SQLContext(sc)

