<?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: Restore partitions in another Hive or Impala after load data into another HDFS in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Restore-partitions-in-another-Hive-or-Impala-after-load-data/m-p/47730#M46023</link>
    <description>&lt;P&gt;Hi Wenbin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope I understood well your use case. So you say that the data files are transferred to the correct HDFS location (with proper partitioning format directories, like partitionname=partitionvalue) but you want to make aware the Hive that there is a new partition on the HDFS.&lt;/P&gt;&lt;P&gt;In this case you need the&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;MSCK REPAIR TABLE table_name&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;command, please see:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-RecoverPartitions(MSCKREPAIRTABLE" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-RecoverPartitions(MSCKREPAIRTABLE&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;In this case you don't need to execute ALTER TABLE ADD PARTITION for each new partition, Hive will recognize it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the newer Impala versions the same functionality exists in Impala as command:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="ph props_rev_2.3.0 props_rev_IMPALA-1568 props_rev_CDH-36799"&gt;ALTER TABLE table_name RECOVER PARTITIONS&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;Miklos Szurap&lt;/P&gt;&lt;P&gt;Customer Operations Engineer&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2016 20:29:59 GMT</pubDate>
    <dc:creator>mszurap</dc:creator>
    <dc:date>2016-11-21T20:29:59Z</dc:date>
    <item>
      <title>Restore partitions in another Hive or Impala after load data into another HDFS</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Restore-partitions-in-another-Hive-or-Impala-after-load-data/m-p/47307#M46022</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Impala, but Hive should have the same problem as Hive is more general so I put the questions in the Hive forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create partitions in another Impala table after I transfer the HDFS data from one HDFS to another, I used some internal file system transfer API, the HDFS is using some comercial storage, not like the original compute/data node disk based HDFS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, after the file transfer, I rerun the show create table result from the source table, the table is created in target.&lt;/P&gt;&lt;P&gt;And I need to update table add partitions for original tables to make target table recognize the partitions in the HDFS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To automate that, it involves read the partitions from source table and use some ways to restore the partitions in the target.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any easy way to do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Wenbin&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:47:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Restore-partitions-in-another-Hive-or-Impala-after-load-data/m-p/47307#M46022</guid>
      <dc:creator>luwenbin</dc:creator>
      <dc:date>2022-09-16T10:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Restore partitions in another Hive or Impala after load data into another HDFS</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Restore-partitions-in-another-Hive-or-Impala-after-load-data/m-p/47730#M46023</link>
      <description>&lt;P&gt;Hi Wenbin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope I understood well your use case. So you say that the data files are transferred to the correct HDFS location (with proper partitioning format directories, like partitionname=partitionvalue) but you want to make aware the Hive that there is a new partition on the HDFS.&lt;/P&gt;&lt;P&gt;In this case you need the&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;MSCK REPAIR TABLE table_name&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;command, please see:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-RecoverPartitions(MSCKREPAIRTABLE" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-RecoverPartitions(MSCKREPAIRTABLE&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;In this case you don't need to execute ALTER TABLE ADD PARTITION for each new partition, Hive will recognize it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the newer Impala versions the same functionality exists in Impala as command:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="ph props_rev_2.3.0 props_rev_IMPALA-1568 props_rev_CDH-36799"&gt;ALTER TABLE table_name RECOVER PARTITIONS&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;Miklos Szurap&lt;/P&gt;&lt;P&gt;Customer Operations Engineer&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 20:29:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Restore-partitions-in-another-Hive-or-Impala-after-load-data/m-p/47730#M46023</guid>
      <dc:creator>mszurap</dc:creator>
      <dc:date>2016-11-21T20:29:59Z</dc:date>
    </item>
  </channel>
</rss>

