<?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 Is there a way to permanenetly purge data in Databricks based on certain condition ? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-permanenetly-purge-data-in-databricks-based-on/m-p/119166#M45809</link>
    <description>&lt;P&gt;Is there a way to permanenetly purge data in Databricks based on certain condition ?&lt;/P&gt;&lt;P&gt;Like, from a particular Databricks table, I want to permanently purge certain rows based on a specific condition e.g., WHERE &amp;lt;col1&amp;gt;="Val1" and &amp;lt;col2&amp;gt;="Val2"&lt;/P&gt;</description>
    <pubDate>Wed, 14 May 2025 11:26:23 GMT</pubDate>
    <dc:creator>soumend7115</dc:creator>
    <dc:date>2025-05-14T11:26:23Z</dc:date>
    <item>
      <title>Is there a way to permanenetly purge data in Databricks based on certain condition ?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-permanenetly-purge-data-in-databricks-based-on/m-p/119166#M45809</link>
      <description>&lt;P&gt;Is there a way to permanenetly purge data in Databricks based on certain condition ?&lt;/P&gt;&lt;P&gt;Like, from a particular Databricks table, I want to permanently purge certain rows based on a specific condition e.g., WHERE &amp;lt;col1&amp;gt;="Val1" and &amp;lt;col2&amp;gt;="Val2"&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 11:26:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-permanenetly-purge-data-in-databricks-based-on/m-p/119166#M45809</guid>
      <dc:creator>soumend7115</dc:creator>
      <dc:date>2025-05-14T11:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to permanenetly purge data in Databricks based on certain condition ?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-permanenetly-purge-data-in-databricks-based-on/m-p/119175#M45811</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/164419"&gt;@soumend7115&lt;/a&gt;!&lt;/P&gt;
&lt;P&gt;I will assume you are talking about managed tables in Unity Catalog here, if thats not the case, let me know.&lt;/P&gt;
&lt;P&gt;We can segregate this in two steps:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;You can use a DELETE FROM SQL statement to remove rows that match your condition. For example:&amp;nbsp;&lt;LI-CODE lang="python"&gt;DELETE FROM table_name WHERE col1 = 'Val1' AND col2 = 'Val2'&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;After running the delete command, the data files are retained a retention period (default is 7 days) to support time travel and rollback. In order to&amp;nbsp;permanently purge the data you can run the&amp;nbsp;VACUUM command. For example:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;VACUUM table_name RETAIN 0 HOURS&lt;/LI-CODE&gt;
&lt;P&gt;This physically deletes unreferenced files immediately. CAUTION: Setting retention to zero hours &lt;STRONG&gt;disables time travel for those files&lt;/STRONG&gt; and should only be used if you're certain the data must be &lt;STRONG&gt;irrecoverable&lt;/STRONG&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Worth mentioning: If you have Deletion Vectors enabled in the table, you may need to run a &lt;A href="https://docs.databricks.com/aws/en/sql/language-manual/delta-reorg-table" target="_self"&gt;REORG TABLE command.&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Documentation reference:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/delta-delete-from" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/delta-delete-from&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/delta-vacuum" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/delta-vacuum&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 12:44:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-permanenetly-purge-data-in-databricks-based-on/m-p/119175#M45811</guid>
      <dc:creator>Lucas_TBrabo</dc:creator>
      <dc:date>2025-05-14T12:44:21Z</dc:date>
    </item>
  </channel>
</rss>

