<?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>topic Small files and discrepancy in S3 vs catalog in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/small-files-and-discrepancy-in-s3-vs-catalog/m-p/49401#M6013</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I'm in the process of optimizing my tables and I'm running into a confusing situation. I have a table named "trace_messages_fg_streaming_event". If I navigate to the Databricks catalog, it shows stats:&lt;/P&gt;&lt;P&gt;Size: &lt;STRONG&gt;6.7GB&lt;/STRONG&gt;, Files: &lt;STRONG&gt;464&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;But when I look at our actual S3 location&lt;/P&gt;&lt;P&gt;File Count: &lt;STRONG&gt;2544762&lt;/STRONG&gt;&lt;BR /&gt;Total Size (in bytes): &lt;STRONG&gt;789695631757 (735.69 gigabytes)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The file count above is gathered using a script parsing an aws s3 ls command line for the root folder of my delta table. This is not a recursive call so it's only counting root files, not files under the delta log folder, etc. We chose not to partition this table as given the size of our data it seemed that Zordering the whole table nightly was a better solution for consolidated files (and thus performance).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table config:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;delta.autoOptimize.autoCompact&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;false&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;delta.autoOptimize.optimizeWrite&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;delta.minReaderVersion&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;delta.minWriterVersion&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;delta.targetFileSize&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;1073741824&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This table is being constantly written to by a write stream, so I understand that there may be smaller files as part of the write, but those should be cleaned up with the nightly optimize. These small files we're seeing are spread out over the past year. Example screen shot:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bfrank1972_0-1697559008309.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/4480iE40A291A73BAEA74/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="bfrank1972_0-1697559008309.png" alt="bfrank1972_0-1697559008309.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Zordering is based on day for these logs - we've tried several approaches including optimize without zordering and we still have many many small files. Also the Zorder doesn't really take that long either (a couple minutes) which is suspicious to me.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any insight/help on what we're seeing would be greatly appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks, Brad&lt;/P&gt;</description>
    <pubDate>Tue, 17 Oct 2023 16:10:40 GMT</pubDate>
    <dc:creator>bfrank1972</dc:creator>
    <dc:date>2023-10-17T16:10:40Z</dc:date>
    <item>
      <title>Small files and discrepancy in S3 vs catalog</title>
      <link>https://community.databricks.com/t5/get-started-discussions/small-files-and-discrepancy-in-s3-vs-catalog/m-p/49401#M6013</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I'm in the process of optimizing my tables and I'm running into a confusing situation. I have a table named "trace_messages_fg_streaming_event". If I navigate to the Databricks catalog, it shows stats:&lt;/P&gt;&lt;P&gt;Size: &lt;STRONG&gt;6.7GB&lt;/STRONG&gt;, Files: &lt;STRONG&gt;464&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;But when I look at our actual S3 location&lt;/P&gt;&lt;P&gt;File Count: &lt;STRONG&gt;2544762&lt;/STRONG&gt;&lt;BR /&gt;Total Size (in bytes): &lt;STRONG&gt;789695631757 (735.69 gigabytes)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The file count above is gathered using a script parsing an aws s3 ls command line for the root folder of my delta table. This is not a recursive call so it's only counting root files, not files under the delta log folder, etc. We chose not to partition this table as given the size of our data it seemed that Zordering the whole table nightly was a better solution for consolidated files (and thus performance).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table config:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;delta.autoOptimize.autoCompact&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;false&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;delta.autoOptimize.optimizeWrite&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;delta.minReaderVersion&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;delta.minWriterVersion&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;delta.targetFileSize&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;1073741824&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This table is being constantly written to by a write stream, so I understand that there may be smaller files as part of the write, but those should be cleaned up with the nightly optimize. These small files we're seeing are spread out over the past year. Example screen shot:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bfrank1972_0-1697559008309.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/4480iE40A291A73BAEA74/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="bfrank1972_0-1697559008309.png" alt="bfrank1972_0-1697559008309.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Zordering is based on day for these logs - we've tried several approaches including optimize without zordering and we still have many many small files. Also the Zorder doesn't really take that long either (a couple minutes) which is suspicious to me.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any insight/help on what we're seeing would be greatly appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks, Brad&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 16:10:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/small-files-and-discrepancy-in-s3-vs-catalog/m-p/49401#M6013</guid>
      <dc:creator>bfrank1972</dc:creator>
      <dc:date>2023-10-17T16:10:40Z</dc:date>
    </item>
  </channel>
</rss>

