无法使用sqlcontext从spark-shell访问hive表

时间:2017-12-01 13:06:23

标签: sql apache-spark hive

(cloudera)我已经从hive创建了一个hive表,但是无法从spark访问它并在spark中使用sqlcontext创建了一个表,无法从hive访问>反之亦然 。但我可以在cloudera中查看hive浏览器界面下的所有表格。如何从spark

访问hive中创建的表

enter image description here

1 个答案:

答案 0 :(得分:0)

如果你没有在spark

中配置hive metastore url,就会发生这种情况

您可以将其添加到hive-site.xml

进行配置
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
    <property>
        <name>hive.metastore.uris</name>
        <value>thrift://host:9083</value>
        <description>IP address (or fully-qualified domain name) and port of the metastore host</description>
    </property>

</configuration>

在我对其他问题的回答中查看更多详细信息:How to access existing table in Hive?