<?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 save results from dataframe into a separate hive table in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-save-results-from-dataframe-into-a-separate-hive/m-p/114203#M54895</link>
    <description>&lt;P&gt;OK - I get this working now. If anyone interested, here you are:&lt;/P&gt;&lt;PRE&gt;val df = sqlContext.sql("SELECT * from table1")
val tempResult = df.filter(df("field1") &amp;gt; 10)
tempResult.write.mode("overwrite").saveAsTable("default.new_table")
val df1 = sqlContext.sql("SELECT * from default.new_table")
df1.show()
&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; the "new_table" table can but does not need to exist before writing to it&lt;/P&gt;</description>
    <pubDate>Mon, 20 Feb 2017 22:19:34 GMT</pubDate>
    <dc:creator>dkozlowski</dc:creator>
    <dc:date>2017-02-20T22:19:34Z</dc:date>
    <item>
      <title>How to save results from dataframe into a separate hive table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-save-results-from-dataframe-into-a-separate-hive/m-p/114202#M54894</link>
      <description>&lt;P&gt;I have got the following:&lt;/P&gt;&lt;PRE&gt;val df = sqlContext.sql("SELECT * from table1")
var tempResult = df.filter(df("field1") &amp;gt; 10)&lt;/PRE&gt;&lt;P&gt;I have also already created another table - table2 - with the same structure as table1.&lt;/P&gt;&lt;P&gt;How can I save/insert the result of tempResult into table2?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 16:52:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-save-results-from-dataframe-into-a-separate-hive/m-p/114202#M54894</guid>
      <dc:creator>dkozlowski</dc:creator>
      <dc:date>2017-02-20T16:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to save results from dataframe into a separate hive table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-save-results-from-dataframe-into-a-separate-hive/m-p/114203#M54895</link>
      <description>&lt;P&gt;OK - I get this working now. If anyone interested, here you are:&lt;/P&gt;&lt;PRE&gt;val df = sqlContext.sql("SELECT * from table1")
val tempResult = df.filter(df("field1") &amp;gt; 10)
tempResult.write.mode("overwrite").saveAsTable("default.new_table")
val df1 = sqlContext.sql("SELECT * from default.new_table")
df1.show()
&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; the "new_table" table can but does not need to exist before writing to it&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 22:19:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-save-results-from-dataframe-into-a-separate-hive/m-p/114203#M54895</guid>
      <dc:creator>dkozlowski</dc:creator>
      <dc:date>2017-02-20T22:19:34Z</dc:date>
    </item>
  </channel>
</rss>

