<?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 Vacuum Command runs without any retention period even though the retention period was set in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/vacuum-command-runs-without-any-retention-period-even-though-the/m-p/151616#M53669</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am trying to do tests on Vacuum in pytest.&lt;/P&gt;&lt;P&gt;Command executed -&amp;gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VACUUM unittest_mobi_edwhc_bul_replikation_001.t_bul_vacuum_experiment_1 RETAIN 0.05150017944444444 HOURS&lt;/P&gt;&lt;P&gt;But the Vacuum command is deleting all files and not considering the provided parameter -RETAIN 0.05150017944444444 HOURS&lt;/P&gt;&lt;P&gt;2026-03-21 23:22:34.965|NULL |NULL |VACUUM START |{retentionCheckEnabled -&amp;gt; false, defaultRetentionMillis -&amp;gt; 172800000, specifiedRetentionMillis -&amp;gt; 0}&lt;/P&gt;&lt;P&gt;Above is the table history which shows that&amp;nbsp;specifiedRetentionMillis =0 .&lt;/P&gt;&lt;P&gt;Why does vacuum delete all the files and not consider the provided parameter ? Am I missing something ?&lt;/P&gt;&lt;P&gt;Thanks in advance for your support .&lt;/P&gt;</description>
    <pubDate>Sun, 22 Mar 2026 09:56:20 GMT</pubDate>
    <dc:creator>bricks_2026</dc:creator>
    <dc:date>2026-03-22T09:56:20Z</dc:date>
    <item>
      <title>Vacuum Command runs without any retention period even though the retention period was set</title>
      <link>https://community.databricks.com/t5/data-engineering/vacuum-command-runs-without-any-retention-period-even-though-the/m-p/151616#M53669</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am trying to do tests on Vacuum in pytest.&lt;/P&gt;&lt;P&gt;Command executed -&amp;gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VACUUM unittest_mobi_edwhc_bul_replikation_001.t_bul_vacuum_experiment_1 RETAIN 0.05150017944444444 HOURS&lt;/P&gt;&lt;P&gt;But the Vacuum command is deleting all files and not considering the provided parameter -RETAIN 0.05150017944444444 HOURS&lt;/P&gt;&lt;P&gt;2026-03-21 23:22:34.965|NULL |NULL |VACUUM START |{retentionCheckEnabled -&amp;gt; false, defaultRetentionMillis -&amp;gt; 172800000, specifiedRetentionMillis -&amp;gt; 0}&lt;/P&gt;&lt;P&gt;Above is the table history which shows that&amp;nbsp;specifiedRetentionMillis =0 .&lt;/P&gt;&lt;P&gt;Why does vacuum delete all the files and not consider the provided parameter ? Am I missing something ?&lt;/P&gt;&lt;P&gt;Thanks in advance for your support .&lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2026 09:56:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/vacuum-command-runs-without-any-retention-period-even-though-the/m-p/151616#M53669</guid>
      <dc:creator>bricks_2026</dc:creator>
      <dc:date>2026-03-22T09:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Vacuum Command runs without any retention period even though the retention period was set</title>
      <link>https://community.databricks.com/t5/data-engineering/vacuum-command-runs-without-any-retention-period-even-though-the/m-p/151645#M53672</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/222050"&gt;@bricks_2026&lt;/a&gt;,&lt;/P&gt;
&lt;P data-pm-slice="1 1 []"&gt;In Databricks, the RETAIN num HOURS clause is interpreted as a whole number of&amp;nbsp;hours, not as a fractional duration.&lt;/P&gt;
&lt;P&gt;In your example:&lt;/P&gt;
&lt;PRE dir="auto"&gt;VACUUM unittest_mobi_edwhc_bul_replikation_001.t_bul_vacuum_experiment_1
RETAIN 0.05150017944444444 HOURS
&lt;/PRE&gt;
&lt;P&gt;that 0.0515... gets reduced to 0 hours internally. With the retention safety check disabled (retentionCheckEnabled -&amp;gt; false), an effective retention of 0 hours means...&amp;nbsp;&lt;SPAN&gt;specifiedRetentionMillis&lt;/SPAN&gt;&lt;SPAN&gt; is logged as &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;VACUUM is allowed to delete all files that are no longer referenced by the latest table state, regardless of age.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;That’s why your DESCRIBE HISTORY shows:&lt;/P&gt;
&lt;PRE dir="auto"&gt;{retentionCheckEnabled -&amp;gt; false,
 defaultRetentionMillis -&amp;gt; 172800000,
 specifiedRetentionMillis -&amp;gt; 0}
&lt;/PRE&gt;
&lt;P&gt;and why all eligible files are removed.&lt;/P&gt;
&lt;P&gt;VACUUM respects your argument, but fractional hours are effectively truncated to whole hours.&amp;nbsp;&lt;SPAN&gt;With the safety check turned off, &lt;/SPAN&gt;&lt;SPAN&gt;RETAIN 0.0515 HOURS&lt;/SPAN&gt;&lt;SPAN&gt; behaves the same as &lt;/SPAN&gt;&lt;SPAN&gt;RETAIN 0 HOURS&lt;/SPAN&gt;&lt;SPAN&gt;, which is why all old files get deleted.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If you want very small test windows, the supported minimum unit is 1 hour, so you’d use e.g.:&lt;/P&gt;
&lt;PRE dir="auto"&gt;VACUUM my_table RETAIN 1 HOURS;
&lt;/PRE&gt;
&lt;P&gt;Appreciate this is not clearly documented but I can confirm this based on some internal research. Hope this helps.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2026 13:47:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/vacuum-command-runs-without-any-retention-period-even-though-the/m-p/151645#M53672</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-03-22T13:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Vacuum Command runs without any retention period even though the retention period was set</title>
      <link>https://community.databricks.com/t5/data-engineering/vacuum-command-runs-without-any-retention-period-even-though-the/m-p/151705#M53688</link>
      <description>&lt;P&gt;Hi Ashwin&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your answer. I also tested it in local pytest yesterday. The minimum supported value is 1 hour.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2026 11:18:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/vacuum-command-runs-without-any-retention-period-even-though-the/m-p/151705#M53688</guid>
      <dc:creator>bricks_2026</dc:creator>
      <dc:date>2026-03-23T11:18:58Z</dc:date>
    </item>
  </channel>
</rss>

