<?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: Importing data from two tables to a single table in Hive in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Importing-data-from-two-tables-to-a-single-table-in-Hive/m-p/112446#M54798</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/12277/utishraj.html" nodeid="12277"&gt;@john doe&lt;/A&gt; use STORED AS ORC instead of RCFILE&lt;/P&gt;&lt;P&gt;also, use CTAS to create a table from one table first, then do on the second table&lt;/P&gt;&lt;P&gt;INSERT INTO TABLE tablename1 [PARTITION (partcol1=val1, partcol2=val2 ...)] (z,y) select_statement1 FROM from_statement;&lt;/P&gt;&lt;P&gt;see if that improves performance, I know it's 2 steps but interesting use case.&lt;/P&gt;</description>
    <pubDate>Sat, 18 Feb 2017 00:31:50 GMT</pubDate>
    <dc:creator>aervits</dc:creator>
    <dc:date>2017-02-18T00:31:50Z</dc:date>
    <item>
      <title>Importing data from two tables to a single table in Hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Importing-data-from-two-tables-to-a-single-table-in-Hive/m-p/112445#M54797</link>
      <description>&lt;P&gt;I've two external tables in Hive that have exactly the same schema and I want to import the data from these two tables into a single table. I can do a UNION ALL from two tables but it seems to be very slow. Example show below. Is there a better way to do this? Thanks. &lt;/P&gt;&lt;PRE&gt;CREATE TABLE MYTABLE
ROW FORMAT SERDE "org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe"
STORED AS RCFILE
AS
SELECT row_number() OVER(), *
FROM
(
SELECT * FROM x
UNION ALL
SELECT * FROM Y
) T2&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Feb 2017 23:47:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Importing-data-from-two-tables-to-a-single-table-in-Hive/m-p/112445#M54797</guid>
      <dc:creator>johnydoe</dc:creator>
      <dc:date>2017-02-17T23:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Importing data from two tables to a single table in Hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Importing-data-from-two-tables-to-a-single-table-in-Hive/m-p/112446#M54798</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/12277/utishraj.html" nodeid="12277"&gt;@john doe&lt;/A&gt; use STORED AS ORC instead of RCFILE&lt;/P&gt;&lt;P&gt;also, use CTAS to create a table from one table first, then do on the second table&lt;/P&gt;&lt;P&gt;INSERT INTO TABLE tablename1 [PARTITION (partcol1=val1, partcol2=val2 ...)] (z,y) select_statement1 FROM from_statement;&lt;/P&gt;&lt;P&gt;see if that improves performance, I know it's 2 steps but interesting use case.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2017 00:31:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Importing-data-from-two-tables-to-a-single-table-in-Hive/m-p/112446#M54798</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2017-02-18T00:31:50Z</dc:date>
    </item>
  </channel>
</rss>

