Spark Guide
Also available as:
PDF

(Optional) Configuring Spark for Hive Access

If Spark was installed manually (without using Ambari), create and edit a hive-site.xml file in the Spark configuration directory:

  1. Create the file SPARK_HOME/conf/hive-site.xml.

  2. Edit the file so that it contains only the hive.metastore.uris property. Make sure that hostname points to the URI where the Hive Metastore is running.

    <configuration>
      <property>
      <name>hive.metastore.uris</name>
      <!-- hostname must point to the Hive Metastore URI in your cluster -->
        <value>thrift://hostname:9083</value>
        <description>URI for client to contact metastore server</description>
      </property>
    </configuration>

If you installed Spark using Ambari, the hive-site.xml file is automatically populated with the correct Hive metastore location.

If you move Hive to a different server, edit the SPARK_HOME/conf/hive-site.xml file so that it contains only the hive.metastore.uris property. Make sure that the hostname points to the URI where the Hive Metastore is running.