sqlContext.tableNames没有获取任何配置单元表

时间:2017-04-01 19:35:52

标签: apache-spark hive

我正在使用CDH 5.8。 当我打开火花壳 并发出以下命令:

sqlContext.tableNames
res0: Array[String] = Array()

我没有获得已经创建的配置单元表。 它应该给我这个:

res0: Arragy[String] = Array(clickstream)

可能出现什么问题?

hive shell表现正常

hive> show tables;
OK
clickstream
Time taken: 0.01 seconds, Fetched: 1 row(s)

这是spark-shell的日志

[cloudera@quickstart ~]$ spark-shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/lib/zookeeper/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/lib/flume-ng/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel).
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /___/ .__/\_,_/_/ /_/\_\   version 1.6.0
      /_/

Using Scala version 2.10.5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_67)
Type in expressions to have them evaluated.
Type :help for more information.
17/04/01 12:33:49 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Spark context available as sc (master = local[*], app id = local-1491075230633).
17/04/01 12:33:56 WARN metastore.ObjectStore: Version information not found in metastore. hive.metastore.schema.verification is not enabled so recording the schema version 1.1.0
17/04/01 12:33:56 WARN metastore.ObjectStore: Failed to get database default, returning NoSuchObjectException
17/04/01 12:33:57 WARN shortcircuit.DomainSocketFactory: The short-circuit local reads feature cannot be used because libhadoop cannot be loaded.
SQL context available as sqlContext.

我可以清楚地看到这可能是问题所在:

17/04/01 12:33:56 WARN metastore.ObjectStore: Version information not found in metastore. hive.metastore.schema.verification is not enabled so recording the schema version 1.1.0
17/04/01 12:33:56 WARN metastore.ObjectStore: **Failed to get database default, returning NoSuchObjectException**

但是这个决议是什么? 我也重启了VM(Ctrl + Alt + Del)。

0 个答案:

没有答案