<?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 &amp;quot;defragment&amp;quot; hdfs data? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-quot-defragment-quot-hdfs-data/m-p/175187#M73068</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2593/zackriesland.html" nodeid="2593"&gt;@Zack Riesland&lt;/A&gt;&lt;A href="https://community.hortonworks.com/users/2593/zackriesland.html"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can create a separate table with only the current day's partition. Merge/consolidate the small files into it.&lt;/P&gt;&lt;P&gt;Then run an exchange partition into the main table to achieve this. &lt;/P&gt;&lt;P&gt;In that way, you do not need to play with the entire data in the main table and this kind of gives you a clean way to achieve this.&lt;/P&gt;&lt;P&gt;Create a shell script and put the commands and do the boundary checks like the end of the day, reprocessing etc and you will have an airtight solution.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jan 2018 21:37:51 GMT</pubDate>
    <dc:creator>rbiswas1</dc:creator>
    <dc:date>2018-01-04T21:37:51Z</dc:date>
    <item>
      <title>How to "defragment" hdfs data?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-quot-defragment-quot-hdfs-data/m-p/175186#M73067</link>
      <description>&lt;P&gt;Suppose a scenario with a Hive table that is partitioned by day ("day=2017-12-12").&lt;/P&gt;&lt;P&gt;Suppose some process pushes data to the file store behind this table (new data under "day=2017-12-12" and "day=2017-12-13", etc).&lt;/P&gt;&lt;P&gt;The "msck repair table" command updates the metastore to recognize all the new "chunks", and the data correctly shows up in queries.&lt;/P&gt;&lt;P&gt;But suppose these chunks are mostly very small - is there a simple command to consolidate these?&lt;/P&gt;&lt;P&gt;So instead of 100 small files under a partition, I get 2 well-sized ones, etc.&lt;/P&gt;&lt;P&gt;I recognize that I can create a copy of the table and accomplish this, but that seems pretty clumsy.&lt;/P&gt;&lt;P&gt;Is there some kind of hdfs command to "defrag" the data?&lt;/P&gt;&lt;P&gt;FWIW, I'm using EMR with data in S3.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 03:59:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-quot-defragment-quot-hdfs-data/m-p/175186#M73067</guid>
      <dc:creator>zack_riesland</dc:creator>
      <dc:date>2018-01-04T03:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to "defragment" hdfs data?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-quot-defragment-quot-hdfs-data/m-p/175187#M73068</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2593/zackriesland.html" nodeid="2593"&gt;@Zack Riesland&lt;/A&gt;&lt;A href="https://community.hortonworks.com/users/2593/zackriesland.html"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can create a separate table with only the current day's partition. Merge/consolidate the small files into it.&lt;/P&gt;&lt;P&gt;Then run an exchange partition into the main table to achieve this. &lt;/P&gt;&lt;P&gt;In that way, you do not need to play with the entire data in the main table and this kind of gives you a clean way to achieve this.&lt;/P&gt;&lt;P&gt;Create a shell script and put the commands and do the boundary checks like the end of the day, reprocessing etc and you will have an airtight solution.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 21:37:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-quot-defragment-quot-hdfs-data/m-p/175187#M73068</guid>
      <dc:creator>rbiswas1</dc:creator>
      <dc:date>2018-01-04T21:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to "defragment" hdfs data?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-quot-defragment-quot-hdfs-data/m-p/175188#M73069</link>
      <description>&lt;P&gt;Thanks for the feedback&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 22:51:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-quot-defragment-quot-hdfs-data/m-p/175188#M73069</guid>
      <dc:creator>zack_riesland</dc:creator>
      <dc:date>2018-01-08T22:51:47Z</dc:date>
    </item>
  </channel>
</rss>

