<?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: dropping a managed table does not remove the underlying files in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/38660#M26699</link>
    <description>&lt;P&gt;Are you using Unity Catalog? If yes, then the data will be deleted from cloud tenant in next 30 days.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/data-governance/unity-catalog/create-tables.html#managed-tables" target="_blank"&gt;https://docs.databricks.com/data-governance/unity-catalog/create-tables.html#managed-tables&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jul 2023 12:13:17 GMT</pubDate>
    <dc:creator>Lakshay</dc:creator>
    <dc:date>2023-07-28T12:13:17Z</dc:date>
    <item>
      <title>dropping a managed table does not remove the underlying files</title>
      <link>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/31799#M23164</link>
      <description>&lt;P&gt;the documentation states that "drop table":&lt;/P&gt;&lt;P&gt;Deletes the table and removes the directory associated with the table from the file system if the table is not&amp;nbsp;&lt;/P&gt;&lt;P&gt;EXTERNAL &amp;nbsp;table. An exception is thrown if the table does not exist.&lt;/P&gt;&lt;P&gt;In case of an external table, only the associated metadata information is removed from the metastore schema.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not work!!&lt;/P&gt;&lt;P&gt;I have a managed table, see below, managed and stored on a mounted Azure storage account:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1503i9CFC4D3775435E76/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;then I execute spark.sql("drop table silver.company")&lt;/P&gt;&lt;P&gt;the result:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;metadata is deleted from the catalog&lt;/LI&gt;&lt;LI&gt;&lt;B&gt;folder is NOT deleted from disk (it should have been deleted as per docs)&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 00:47:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/31799#M23164</guid>
      <dc:creator>my_community2</dc:creator>
      <dc:date>2022-09-14T00:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: dropping a managed table does not remove the underlying files</title>
      <link>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/31801#M23166</link>
      <description>&lt;P&gt;&lt;B&gt;docs at&lt;/B&gt; &lt;A href="https://docs.microsoft.com/en-us/azure/databricks/spark/latest/spark-sql/language-manual/sql-ref-syntax-ddl-drop-table" target="test_blank"&gt;https://docs.microsoft.com/en-us/azure/databricks/spark/latest/spark-sql/language-manual/sql-ref-syntax-ddl-drop-table&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;to mount a drive in databricks via the following python code&lt;/B&gt;&lt;/P&gt;&lt;P&gt;mountPoint = "/mnt/bronze"&lt;/P&gt;&lt;P&gt;accountName = "&amp;lt;provide account name&amp;gt;"&lt;/P&gt;&lt;P&gt;containerName = "bronze"&lt;/P&gt;&lt;P&gt;account_key = "&amp;lt;provide account key&amp;gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dbutils.fs.mount(&lt;/P&gt;&lt;P&gt;&amp;nbsp;source = f"wasbs://{containerName}@{accountName}.blob.core.windows.net",&lt;/P&gt;&lt;P&gt;&amp;nbsp;mount_point = mountPoint,&lt;/P&gt;&lt;P&gt;&amp;nbsp;extra_configs = {f"fs.azure.account.key.{accountName}.blob.core.windows.net" : account_key} )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;to create a table just CREATE ...&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;then drop, the directory with all files remain after dropping a table&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 17:45:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/31801#M23166</guid>
      <dc:creator>my_community2</dc:creator>
      <dc:date>2022-09-15T17:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: dropping a managed table does not remove the underlying files</title>
      <link>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/31802#M23167</link>
      <description>&lt;P&gt;Hi @Maciej G​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We'd love to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 12:16:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/31802#M23167</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-27T12:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: dropping a managed table does not remove the underlying files</title>
      <link>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/31800#M23165</link>
      <description>&lt;P&gt;Hi, Could you please mention the document which was followed for the issue and also to configure the external metadata? Also, could you please state the steps. &lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 04:23:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/31800#M23165</guid>
      <dc:creator>Debayan</dc:creator>
      <dc:date>2022-09-15T04:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: dropping a managed table does not remove the underlying files</title>
      <link>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/38650#M26696</link>
      <description>&lt;P&gt;Hi, did you solve this issue? I have the very same issue with managed tables now.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 10:20:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/38650#M26696</guid>
      <dc:creator>alesventus</dc:creator>
      <dc:date>2023-07-28T10:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: dropping a managed table does not remove the underlying files</title>
      <link>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/38660#M26699</link>
      <description>&lt;P&gt;Are you using Unity Catalog? If yes, then the data will be deleted from cloud tenant in next 30 days.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/data-governance/unity-catalog/create-tables.html#managed-tables" target="_blank"&gt;https://docs.databricks.com/data-governance/unity-catalog/create-tables.html#managed-tables&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 12:13:17 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/38660#M26699</guid>
      <dc:creator>Lakshay</dc:creator>
      <dc:date>2023-07-28T12:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: dropping a managed table does not remove the underlying files</title>
      <link>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/38681#M26715</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/75166"&gt;@alesventus&lt;/a&gt;&amp;nbsp;how you are creating your table, is that in unity catalog and are you using managed with external location. usually you should not specify any location for managed table . by default it gets created in hive metastore if you are not using unity catalog. please send what type of query you have used to create managed table.&lt;/P&gt;&lt;P&gt;if location is not used during table creation, then drop should work&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 15:55:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/38681#M26715</guid>
      <dc:creator>karthik_p</dc:creator>
      <dc:date>2023-07-28T15:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: dropping a managed table does not remove the underlying files</title>
      <link>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/38751#M26743</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/72939"&gt;@karthik_p&lt;/a&gt;&amp;nbsp;, correct answer is the one given by&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/75976"&gt;@Lakshay&lt;/a&gt;&amp;nbsp;There is 30 days retention after delete of managed table.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 06:54:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/38751#M26743</guid>
      <dc:creator>alesventus</dc:creator>
      <dc:date>2023-07-31T06:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: dropping a managed table does not remove the underlying files</title>
      <link>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/44718#M27698</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;There is a way to force delete files after drop the table and don't wait 30 days to see size in S3 decrease?&lt;/P&gt;&lt;P&gt;Tables that I dropped related to the dev and staging, I don't want to keep there files for 30 days&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 08:21:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/44718#M27698</guid>
      <dc:creator>MajdSAAD_7953</dc:creator>
      <dc:date>2023-09-14T08:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: dropping a managed table does not remove the underlying files</title>
      <link>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/92315#M38400</link>
      <description>&lt;P&gt;Perhaps this post might be useful to you:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.databricks.com/t5/data-engineering/databricks-drop-and-remove-s3-storage-files-safely/m-p/34569#M25311" target="_blank"&gt;https://community.databricks.com/t5/data-engineering/databricks-drop-and-remove-s3-storage-files-safely/m-p/34569#M25311&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 14:12:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dropping-a-managed-table-does-not-remove-the-underlying-files/m-p/92315#M38400</guid>
      <dc:creator>n_joy</dc:creator>
      <dc:date>2024-09-30T14:12:50Z</dc:date>
    </item>
  </channel>
</rss>

