<?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: Loda data into hive using spark howvere how does spark recognize or identify database name in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loda-data-into-hive-using-spark-howvere-how-does-spark/m-p/228405#M63915</link>
    <description>&lt;P&gt;Thanks , it helped a lot to clear my confusion.&lt;/P&gt;</description>
    <pubDate>Sat, 01 Jul 2017 00:07:37 GMT</pubDate>
    <dc:creator>HDave113</dc:creator>
    <dc:date>2017-07-01T00:07:37Z</dc:date>
    <item>
      <title>Loda data into hive using spark howvere how does spark recognize or identify database name</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loda-data-into-hive-using-spark-howvere-how-does-spark/m-p/228403#M63913</link>
      <description>&lt;P&gt;I have gone through below URL to understand how to load data into HIVE using spark in orc format. I understood how to create table in HIVE using spark howvere I have one question that how would spark identify that in which database this table should be created or if I have same table name in two different HIVE DB in which table spark is going to insert values &lt;/P&gt;&lt;P&gt;I have gone through below URL:&lt;/P&gt;&lt;P&gt;&lt;A href="https://hortonworks.com/tutorial/using-hive-with-orc-from-apache-spark/" target="_blank"&gt;https://hortonworks.com/tutorial/using-hive-with-orc-from-apache-spark/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 20:39:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loda-data-into-hive-using-spark-howvere-how-does-spark/m-p/228403#M63913</guid>
      <dc:creator>HDave113</dc:creator>
      <dc:date>2017-06-29T20:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Loda data into hive using spark howvere how does spark recognize or identify database name</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loda-data-into-hive-using-spark-howvere-how-does-spark/m-p/228404#M63914</link>
      <description>&lt;P&gt;In hive, if you do not specify the database name in your query then it will refer to the default database. The name of the default database itself is 'default'.&lt;/P&gt;&lt;P&gt;So the query in the URL you shared :&lt;/P&gt;&lt;PRE&gt;hiveContext.sql("create table yahoo_orc_table (date STRING, open_price FLOAT, high_price FLOAT, low_price FLOAT, close_price FLOAT, volume INT, adj_price FLOAT) stored as orc")&lt;/PRE&gt;&lt;P&gt;This will create yahoo_orc_table under default database.&lt;/P&gt;&lt;P&gt;If you want to create it in a specific database say 'hardikdatabase', then you must specify databasename.tablename as shown below (hardikdatabase.yahoo_orc_table):&lt;/P&gt;&lt;PRE&gt;hiveContext.sql("create table hardikdatabase.yahoo_orc_table (date STRING, open_price FLOAT, high_price FLOAT, low_price FLOAT, close_price FLOAT, volume INT, adj_price FLOAT) stored as orc")&lt;/PRE&gt;&lt;P&gt;This same rule applies when you want to read data from hive. You must specify the database in the same way unless it is the default database.&lt;/P&gt;&lt;P&gt;As always, if this answer helps you, please consider accepting it.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 21:33:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loda-data-into-hive-using-spark-howvere-how-does-spark/m-p/228404#M63914</guid>
      <dc:creator>dineshc</dc:creator>
      <dc:date>2017-06-29T21:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Loda data into hive using spark howvere how does spark recognize or identify database name</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loda-data-into-hive-using-spark-howvere-how-does-spark/m-p/228405#M63915</link>
      <description>&lt;P&gt;Thanks , it helped a lot to clear my confusion.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2017 00:07:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loda-data-into-hive-using-spark-howvere-how-does-spark/m-p/228405#M63915</guid>
      <dc:creator>HDave113</dc:creator>
      <dc:date>2017-07-01T00:07:37Z</dc:date>
    </item>
  </channel>
</rss>

