<?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: It is possible insert data into a table A from another B by subquery in HIVE? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/It-is-possible-insert-data-into-a-table-A-from-another-B-by/m-p/155060#M117499</link>
    <description>&lt;P&gt;The columns and orders just need to match. Not sure about the question.&lt;/P&gt;&lt;P&gt;Let's assume &lt;/P&gt;&lt;P&gt;Table A ( daily data ) &lt;/P&gt;&lt;P&gt;col a, col b, col c, col dt&lt;/P&gt;&lt;P&gt;Table B ( fact table with subset of columns reordered ) &lt;/P&gt;&lt;P&gt;col c, col a partitioned by dt &lt;/P&gt;&lt;P&gt;So if you know the date is only today you can just select the columns you need in the order you need them:&lt;/P&gt;&lt;P&gt;INSERT INTO B PARTITION (dt=1805 ) SELECT c,a from A;&lt;/P&gt;&lt;P&gt;or if you want dynamic partitoning you need to add the partition column at the end:&lt;/P&gt;&lt;P&gt;INSERT INTO B PARTITION (dt ) SELECT c,a,dt from A; &lt;/P&gt;</description>
    <pubDate>Thu, 19 May 2016 00:27:06 GMT</pubDate>
    <dc:creator>bleonhardi</dc:creator>
    <dc:date>2016-05-19T00:27:06Z</dc:date>
  </channel>
</rss>

