<?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 Re: Impact of VACUUM Operations on Shallow Clones in Databricks in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/impact-of-vacuum-operations-on-shallow-clones-in-databricks/m-p/119535#M45901</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/164825"&gt;@chsoni12&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;H3&gt;Using UC:&lt;/H3&gt;&lt;P class=""&gt;Databricks &lt;SPAN class=""&gt;&lt;STRONG&gt;tracks metadata dependencies&lt;/STRONG&gt;&lt;/SPAN&gt; between the source and the clone. This means:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;&lt;STRONG&gt;VACUUM on the source table will not delete any data files&lt;/STRONG&gt;&lt;SPAN class=""&gt; if they are still referenced by the shallow clone.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Even after the retention period, VACUUM only removes files &lt;SPAN class=""&gt;&lt;STRONG&gt;not needed&lt;/STRONG&gt;&lt;/SPAN&gt; by &lt;SPAN class=""&gt;&lt;STRONG&gt;any Delta table&lt;/STRONG&gt;&lt;/SPAN&gt;, including the clone.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;So: &lt;SPAN class=""&gt;&lt;STRONG&gt;your clone remains safe&lt;/STRONG&gt;&lt;/SPAN&gt;, even if the source table is modified (insert/delete/truncate) or vacuumed.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;Not using UC:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;Shallow clones are &lt;SPAN class=""&gt;&lt;STRONG&gt;not protected&lt;/STRONG&gt;&lt;/SPAN&gt; the same way.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;If a file is no longer needed by the source table and you run &lt;SPAN class=""&gt;VACUUM&lt;/SPAN&gt;, it &lt;SPAN class=""&gt;&lt;STRONG&gt;can be deleted&lt;/STRONG&gt;&lt;/SPAN&gt;, even if the clone still references it.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;That would break your clone (queries could fail due to missing files).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2 id="limitations"&gt;Some limitations&lt;A class="" title="Direct link to Limitations" href="https://docs.databricks.com/aws/en/delta/clone-unity-catalog#limitations" target="_blank" rel="noopener"&gt;​&lt;/A&gt;&lt;/H2&gt;&lt;UL&gt;&lt;LI&gt;Shallow clones on external tables must be external tables. Shallow clones on managed tables must be managed tables.&lt;/LI&gt;&lt;LI&gt;You cannot use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;REPLACE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;CREATE OR REPLACE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to overwrite an existing shallow clone. Instead,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;DROP&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;the shallow clone and run a new&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;CREATE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;statement.&lt;/LI&gt;&lt;LI&gt;You cannot nest shallow clones, meaning you cannot make a shallow clone from a shallow clone.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;References:&amp;nbsp;&lt;A href="https://docs.databricks.com/aws/en/delta/clone-unity-catalog" target="_self"&gt;Databricks Docs&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Hope this helps, &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Isi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 17 May 2025 19:10:48 GMT</pubDate>
    <dc:creator>Isi</dc:creator>
    <dc:date>2025-05-17T19:10:48Z</dc:date>
    <item>
      <title>Impact of VACUUM Operations on Shallow Clones in Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/impact-of-vacuum-operations-on-shallow-clones-in-databricks/m-p/119528#M45899</link>
      <description>&lt;P&gt;I performed a POC where i have to check that can we create a new delta table which contains only particular version of data of normal delta table without copying the data and if we make changes or perform any operation(insert/delete/truncate/records) or running a vacuum in the normal delta table. It should not impact the new delta table.&lt;/P&gt;&lt;P&gt;I used the databricks shallow clone to create the new delta table from the normal delta table. This operation did not copy the data of a particular version in new delta table. It was referencing the same file which normal table was using and also performed some operations like insert, delete, truncate and vacuum on normal delta table but it did not impact the new delta table created by using shallow clone.&lt;BR /&gt;&lt;BR /&gt;Databricks Concept says:-&lt;BR /&gt;1) Data of clone table(new delta table) may be impacted of deleted if we perform any operation(like vacuum) in the normal table.&lt;BR /&gt;2) Until and unless file is referenced by any delta table, it won't delete the file.&lt;BR /&gt;3) Also after running the Vacuum, it will not delete the data if it is referenced by delta table even after the retention period because it deletes only old data which is not referenced by a delta table.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So my question is Vacuum or any other operation impact the clone table or not ? Because the concept 2 says , it won't impact. Is my understanding correct?&lt;/P&gt;</description>
      <pubDate>Sat, 17 May 2025 10:14:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/impact-of-vacuum-operations-on-shallow-clones-in-databricks/m-p/119528#M45899</guid>
      <dc:creator>chsoni12</dc:creator>
      <dc:date>2025-05-17T10:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Impact of VACUUM Operations on Shallow Clones in Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/impact-of-vacuum-operations-on-shallow-clones-in-databricks/m-p/119535#M45901</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/164825"&gt;@chsoni12&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;H3&gt;Using UC:&lt;/H3&gt;&lt;P class=""&gt;Databricks &lt;SPAN class=""&gt;&lt;STRONG&gt;tracks metadata dependencies&lt;/STRONG&gt;&lt;/SPAN&gt; between the source and the clone. This means:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;&lt;STRONG&gt;VACUUM on the source table will not delete any data files&lt;/STRONG&gt;&lt;SPAN class=""&gt; if they are still referenced by the shallow clone.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Even after the retention period, VACUUM only removes files &lt;SPAN class=""&gt;&lt;STRONG&gt;not needed&lt;/STRONG&gt;&lt;/SPAN&gt; by &lt;SPAN class=""&gt;&lt;STRONG&gt;any Delta table&lt;/STRONG&gt;&lt;/SPAN&gt;, including the clone.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;So: &lt;SPAN class=""&gt;&lt;STRONG&gt;your clone remains safe&lt;/STRONG&gt;&lt;/SPAN&gt;, even if the source table is modified (insert/delete/truncate) or vacuumed.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;Not using UC:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;Shallow clones are &lt;SPAN class=""&gt;&lt;STRONG&gt;not protected&lt;/STRONG&gt;&lt;/SPAN&gt; the same way.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;If a file is no longer needed by the source table and you run &lt;SPAN class=""&gt;VACUUM&lt;/SPAN&gt;, it &lt;SPAN class=""&gt;&lt;STRONG&gt;can be deleted&lt;/STRONG&gt;&lt;/SPAN&gt;, even if the clone still references it.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;That would break your clone (queries could fail due to missing files).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2 id="limitations"&gt;Some limitations&lt;A class="" title="Direct link to Limitations" href="https://docs.databricks.com/aws/en/delta/clone-unity-catalog#limitations" target="_blank" rel="noopener"&gt;​&lt;/A&gt;&lt;/H2&gt;&lt;UL&gt;&lt;LI&gt;Shallow clones on external tables must be external tables. Shallow clones on managed tables must be managed tables.&lt;/LI&gt;&lt;LI&gt;You cannot use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;REPLACE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;CREATE OR REPLACE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to overwrite an existing shallow clone. Instead,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;DROP&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;the shallow clone and run a new&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;CREATE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;statement.&lt;/LI&gt;&lt;LI&gt;You cannot nest shallow clones, meaning you cannot make a shallow clone from a shallow clone.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;References:&amp;nbsp;&lt;A href="https://docs.databricks.com/aws/en/delta/clone-unity-catalog" target="_self"&gt;Databricks Docs&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Hope this helps, &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Isi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 May 2025 19:10:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/impact-of-vacuum-operations-on-shallow-clones-in-databricks/m-p/119535#M45901</guid>
      <dc:creator>Isi</dc:creator>
      <dc:date>2025-05-17T19:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Impact of VACUUM Operations on Shallow Clones in Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/impact-of-vacuum-operations-on-shallow-clones-in-databricks/m-p/119538#M45903</link>
      <description>&lt;P&gt;Thanks&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;. It really helps me a lot But there is also an issue in shallow clone. We can only clone the full table data, particular delta version data using timestamp/version from the normal table using shallow clone but we can not clone the table data by applying filter condition on a particular column. For that we need to copy data. We do not have any databricks native approach to achieve without copying data. Is my understanding correct?&lt;/P&gt;</description>
      <pubDate>Sat, 17 May 2025 19:53:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/impact-of-vacuum-operations-on-shallow-clones-in-databricks/m-p/119538#M45903</guid>
      <dc:creator>chsoni12</dc:creator>
      <dc:date>2025-05-17T19:53:25Z</dc:date>
    </item>
  </channel>
</rss>

