<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Hive databases are not visible in Spark session. in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239789#M201598</link>
    <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/19399/dbompart.html" nodeid="19399" target="_blank"&gt;@dbompart,&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks for the answer,&lt;/P&gt;&lt;P&gt;I am using HDP3.1,&lt;/P&gt;&lt;P&gt;I've tried to change the settings per link "&lt;A rel="noopener noreferrer noopener noreferrer nofollow noopener noreferrer" href="https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.1.0/integrating-hive/content/hive_configure_a_spark_hive_connection.html" target="_blank"&gt;https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.1.0/integrating-hive/content/hive_configure_a_spark_hive_connection.html&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;1) Spark setting below&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="110334-screenshot-from-2019-08-13-09-22-34.png" style="width: 1293px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/13905iAD5F9FF15CDC550C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="110334-screenshot-from-2019-08-13-09-22-34.png" alt="110334-screenshot-from-2019-08-13-09-22-34.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2) Trying to get hive databases in spark - no success;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="110335-screenshot-from-2019-08-13-09-23-29.png" style="width: 831px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/13906iBB0B03F5FB194CBB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="110335-screenshot-from-2019-08-13-09-23-29.png" alt="110335-screenshot-from-2019-08-13-09-23-29.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3) Can see hive databases in hive&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="110336-screenshot-from-2019-08-13-09-25-52.png" style="width: 1440px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/13907iAACDA9C7E0EDF21C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="110336-screenshot-from-2019-08-13-09-25-52.png" alt="110336-screenshot-from-2019-08-13-09-25-52.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Could you please assist me on this, what else needs to be done.&lt;/P&gt;</description>
    <pubDate>Sat, 17 Aug 2019 22:36:10 GMT</pubDate>
    <dc:creator>shashank_naresh</dc:creator>
    <dc:date>2019-08-17T22:36:10Z</dc:date>
    <item>
      <title>Hive databases are not visible in Spark session.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239786#M201595</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to run spark application which will need access to Hive databases. But Hive databases like FOODMART are not visible in spark session.&lt;/P&gt;&lt;P&gt;I did &lt;STRONG&gt;spark.sql("show databases").show()&lt;/STRONG&gt;; it is not showing Foodmart database, though spark session is having enableHiveSupport.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Below i've tried:&lt;/P&gt;&lt;P&gt;1)&lt;/P&gt;&lt;P&gt;cp /etc/hive/conf/hive-site.xml /etc/spark2/conf&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;Changed spark.sql.warehouse.dir in spark UI from &lt;STRONG&gt;/apps/spark/warehouse&lt;/STRONG&gt; to &lt;STRONG&gt;/warehouse/tablespace/managed/hive&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Even though it is not working.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please let me know what configuration changes would be required to have this.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please note - Above is working in HDP2.6.5.&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2019 11:43:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239786#M201595</guid>
      <dc:creator>shashank_naresh</dc:creator>
      <dc:date>2019-05-05T11:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Hive databases are not visible in Spark session.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239787#M201596</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/113793/shashanknaresh.html" nodeid="113793"&gt;@Shashank Naresh&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It's not clear what is your current version, I'll assume HDP3. If that is the case, you may want to read the following links, along with its internal links:&lt;/P&gt;&lt;P&gt;Spark to Hive access on HDP3 - &lt;A href="https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.1.0/integrating-hive/content/hive_hivewarehouseconnector_for_handling_apache_spark_data.html"&gt;https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.1.0/integrating-hive/content/hive_hivewarehouseconnector_for_handling_apache_spark_data.html&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Configuration - &lt;A href="https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.1.0/integrating-hive/content/hive_configure_a_spark_hive_connection.html"&gt;https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.1.0/integrating-hive/content/hive_configure_a_spark_hive_connection.html&lt;/A&gt; &lt;/P&gt;&lt;P&gt;API Operations - &lt;A href="https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.1.0/integrating-hive/content/hive_hivewarehousesession_api_operations.html"&gt;https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.1.0/integrating-hive/content/hive_hivewarehousesession_api_operations.html&lt;/A&gt; &lt;/P&gt;&lt;P&gt;In short, Spark has its own catalog, meaning that you will not natively have access to Hive catalog as you did on HDP2.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;David Bompart&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2019 02:11:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239787#M201596</guid>
      <dc:creator>dbompart</dc:creator>
      <dc:date>2019-05-11T02:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Hive databases are not visible in Spark session.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239788#M201597</link>
      <description>&lt;P&gt;I am using HDP 3.1.0&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2019 07:18:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239788#M201597</guid>
      <dc:creator>shashank_naresh</dc:creator>
      <dc:date>2019-08-13T07:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Hive databases are not visible in Spark session.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239789#M201598</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/19399/dbompart.html" nodeid="19399" target="_blank"&gt;@dbompart,&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks for the answer,&lt;/P&gt;&lt;P&gt;I am using HDP3.1,&lt;/P&gt;&lt;P&gt;I've tried to change the settings per link "&lt;A rel="noopener noreferrer noopener noreferrer nofollow noopener noreferrer" href="https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.1.0/integrating-hive/content/hive_configure_a_spark_hive_connection.html" target="_blank"&gt;https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.1.0/integrating-hive/content/hive_configure_a_spark_hive_connection.html&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;1) Spark setting below&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="110334-screenshot-from-2019-08-13-09-22-34.png" style="width: 1293px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/13905iAD5F9FF15CDC550C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="110334-screenshot-from-2019-08-13-09-22-34.png" alt="110334-screenshot-from-2019-08-13-09-22-34.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2) Trying to get hive databases in spark - no success;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="110335-screenshot-from-2019-08-13-09-23-29.png" style="width: 831px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/13906iBB0B03F5FB194CBB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="110335-screenshot-from-2019-08-13-09-23-29.png" alt="110335-screenshot-from-2019-08-13-09-23-29.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3) Can see hive databases in hive&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="110336-screenshot-from-2019-08-13-09-25-52.png" style="width: 1440px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/13907iAACDA9C7E0EDF21C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="110336-screenshot-from-2019-08-13-09-25-52.png" alt="110336-screenshot-from-2019-08-13-09-25-52.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Could you please assist me on this, what else needs to be done.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Aug 2019 22:36:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239789#M201598</guid>
      <dc:creator>shashank_naresh</dc:creator>
      <dc:date>2019-08-17T22:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Hive databases are not visible in Spark session.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239790#M201599</link>
      <description>&lt;P&gt;Hey Shashank,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You're still skipping the link to: API Operations - &lt;A rel="nofollow" href="https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.1.0/integrating-hive/content/hive_hivewarehousesession_api_operations.html"&gt;https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.1.0/integrating-hive/content/hive_hivewarehousesession_api_operations.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Listing the databases in Hive from Spark using the SparkSQL API will not work, as long as metastore.default.catalog is set to "spark" which is the default value and recommended to leave it as it is. So to summarize, by default SparkSQL API (spark.sql("$query")) will access the Spark catalog, instead you should be using the HiveWarehouseSessionAPI as explained in the link above, something like:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;import com.hortonworks.hwc.HiveWarehouseSession

import com.hortonworks.hwc.HiveWarehouseSession._

val hive = HiveWarehouseSession.session(spark).build()
hive.showDatabases().show()
hive.setDatabase("foodmart")
hive.showTables().show()
hive.execute("describe formatted foodmartTable").show()
hive.executeQuery("select * from foodmartTable limit 5").show()&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Aug 2019 22:54:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239790#M201599</guid>
      <dc:creator>dbompart</dc:creator>
      <dc:date>2019-08-13T22:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Hive databases are not visible in Spark session.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239791#M201600</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/19399/dbompart.html" nodeid="19399" target="_blank"&gt;@dbompart,&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply;&lt;/P&gt;&lt;P&gt;I've tried below:&lt;/P&gt;&lt;P&gt;1) Changed the Zeppelin setting per below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="110382-screenshot-from-2019-08-13-22-51-21.png" style="width: 1007px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/13903iBD2D096A22BC3944/image-size/medium?v=v2&amp;amp;px=400" role="button" title="110382-screenshot-from-2019-08-13-22-51-21.png" alt="110382-screenshot-from-2019-08-13-22-51-21.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2) Restarted notebook&lt;/P&gt;&lt;P&gt;3) Tried below code in notebook and getting below import error.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="110383-screenshot-from-2019-08-13-22-52-36.png" style="width: 822px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/13904i8E2BFAB9C6C8603C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="110383-screenshot-from-2019-08-13-22-52-36.png" alt="110383-screenshot-from-2019-08-13-22-52-36.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Requesting to assist here.&lt;/P&gt;&lt;P&gt;Thanks and Regards.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Aug 2019 22:35:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239791#M201600</guid>
      <dc:creator>shashank_naresh</dc:creator>
      <dc:date>2019-08-17T22:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Hive databases are not visible in Spark session.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239792#M201601</link>
      <description>&lt;P&gt;Zeppelin and Spark-shell are not the same client and properties work diferently, if you moved on to Zeppelin can we assume it did work for Spark-shell?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;In regard to the Zeppelin issue, the problem should be within the the path to the hive warehouse connector file either on the spark.jars or the spark.submit.pyFiles, I believe the path must be whitelisted in Zeppelin, but its clear that the hivewarehouseconnector files are not being succesfully uploaded to the application classpath, therefore, the pyspark_llap module cannot be imported. Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 02:34:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-databases-are-not-visible-in-Spark-session/m-p/239792#M201601</guid>
      <dc:creator>dbompart</dc:creator>
      <dc:date>2019-08-14T02:34:38Z</dc:date>
    </item>
  </channel>
</rss>

