<?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: how to access hive database/tables through spark and pyspark shell? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/how-to-access-hive-database-tables-through-spark-and-pyspark/m-p/91178#M3914</link>
    <description>&lt;P&gt;from spark or pyspark shell use the below commands to access hive database objects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;spark.sql("show databases;")&lt;/P&gt;&lt;P&gt;spark.sql("select * from databasename.tablename;")&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;spark.read.table("databasename.tablename")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can give any query inside spark.sql which will give you results.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jun 2019 20:46:19 GMT</pubDate>
    <dc:creator>Yeseswini</dc:creator>
    <dc:date>2019-06-03T20:46:19Z</dc:date>
  </channel>
</rss>

