<?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: DataFrame.insertInto() an existing hive table encounter &amp;quot;Table Not Found&amp;quot; error in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/DataFrame-insertInto-an-existing-hive-table-encounter-quot/m-p/98174#M11654</link>
    <description>&lt;P&gt;Figured it out, it has to be HiveContext, not SQLContext, after making below change, it works:&lt;/P&gt;&lt;P&gt;HiveContext hiveContext = new org.apache.spark.sql.hive.HiveContext(sc.sc());&lt;/P&gt;&lt;P&gt;//SQLContext sqlContext = new org.apache.spark.sql.SQLContext(sc);&lt;/P&gt;</description>
    <pubDate>Wed, 09 Dec 2015 05:50:25 GMT</pubDate>
    <dc:creator>rxu</dc:creator>
    <dc:date>2015-12-09T05:50:25Z</dc:date>
    <item>
      <title>DataFrame.insertInto() an existing hive table encounter "Table Not Found" error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/DataFrame-insertInto-an-existing-hive-table-encounter-quot/m-p/98171#M11651</link>
      <description>&lt;P&gt;Java code:&lt;/P&gt;&lt;P&gt;DataFrame peopleDataFrame = sqlContext.createDataFrame(rowRDD, schema);&lt;/P&gt;&lt;P&gt;HiveContext hiveContext = new org.apache.spark.sql.hive.HiveContext( jsc.sc() );&lt;/P&gt;&lt;P&gt;hiveContext.sql("CREATE TABLE IF NOT EXISTS people_t1 (emp_id string, first_name string, last_name string, job_title string, mgr_emp_id string)");&lt;/P&gt;&lt;P&gt;// Register the DataFrame as a table.&lt;/P&gt;&lt;P&gt;peopleDataFrame.registerTempTable("people");&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;peopleDataFrame.insertInto("default.people_t1", true);&lt;/P&gt;&lt;P&gt;Got:&lt;/P&gt;&lt;P&gt;java.lang.RuntimeException: Table Not Found: default.people_t1&lt;/P&gt;&lt;P&gt;While table does exist in Hive:&lt;/P&gt;&lt;P&gt;hive&amp;gt; describe people_t1; &lt;/P&gt;&lt;P&gt;OK &lt;/P&gt;&lt;P&gt;emp_id              string &lt;/P&gt;&lt;P&gt;first_name          string &lt;/P&gt;&lt;P&gt;last_name           string &lt;/P&gt;&lt;P&gt;job_title           string &lt;/P&gt;&lt;P&gt;mgr_emp_id          string &lt;/P&gt;&lt;P&gt;Time taken: 0.284 seconds, Fetched: 5 row(s)&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 03:44:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/DataFrame-insertInto-an-existing-hive-table-encounter-quot/m-p/98171#M11651</guid>
      <dc:creator>rxu</dc:creator>
      <dc:date>2015-12-09T03:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: DataFrame.insertInto() an existing hive table encounter "Table Not Found" error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/DataFrame-insertInto-an-existing-hive-table-encounter-quot/m-p/98172#M11652</link>
      <description>&lt;P&gt;What version of Spark? I assume you are using Spark 1.5.1 from Tech Preview. What if you try using the DataFrameWriter class, saveAsTable() method. That may not work for you if you really are INSERTing records to an existing table, but could work if you mean to OVERWRITE the table. &lt;/P&gt;&lt;P&gt;Documentation here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://spark.apache.org/docs/latest/api/scala/#org.apache.spark.sql.DataFrameWriter"&gt;http://spark.apache.org/docs/latest/api/scala/#org.apache.spark.sql.DataFrameWriter&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 04:12:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/DataFrame-insertInto-an-existing-hive-table-encounter-quot/m-p/98172#M11652</guid>
      <dc:creator>phargis</dc:creator>
      <dc:date>2015-12-09T04:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: DataFrame.insertInto() an existing hive table encounter "Table Not Found" error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/DataFrame-insertInto-an-existing-hive-table-encounter-quot/m-p/98173#M11653</link>
      <description>&lt;P&gt;I am using Spark 1.3.1. Seems that saveAsTable() creates internal Spark table source.&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/31482798/save-spark-dataframe-to-hive-table-not-readable-because-parquet-not-a-sequence" target="_blank"&gt;http://stackoverflow.com/questions/31482798/save-spark-dataframe-to-hive-table-not-readable-because-parquet-not-a-sequence&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 04:45:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/DataFrame-insertInto-an-existing-hive-table-encounter-quot/m-p/98173#M11653</guid>
      <dc:creator>rxu</dc:creator>
      <dc:date>2015-12-09T04:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: DataFrame.insertInto() an existing hive table encounter "Table Not Found" error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/DataFrame-insertInto-an-existing-hive-table-encounter-quot/m-p/98174#M11654</link>
      <description>&lt;P&gt;Figured it out, it has to be HiveContext, not SQLContext, after making below change, it works:&lt;/P&gt;&lt;P&gt;HiveContext hiveContext = new org.apache.spark.sql.hive.HiveContext(sc.sc());&lt;/P&gt;&lt;P&gt;//SQLContext sqlContext = new org.apache.spark.sql.SQLContext(sc);&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 05:50:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/DataFrame-insertInto-an-existing-hive-table-encounter-quot/m-p/98174#M11654</guid>
      <dc:creator>rxu</dc:creator>
      <dc:date>2015-12-09T05:50:25Z</dc:date>
    </item>
  </channel>
</rss>

