<?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: Programatically remove external table completely (Azure) in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/programatically-remove-external-table-completely-azure/m-p/95454#M39105</link>
    <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/79252"&gt;@johnb1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can achieve this with the code below. Please review.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;table_name = "table_name"
location = "abfss://container@storage-account.dfs.core.windows.net/path/to/table/data/" 

spark.sql(f"DROP TABLE IF EXISTS {table_name}")
dbutils.fs.rm(location, recurse=True)

########################################
#Note even you can extract location by doing below
df = spark.sql(f"DESCRIBE DETAIL {table_name}")
location = df.select("location").collect()[0]["location"]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Oct 2024 10:40:31 GMT</pubDate>
    <dc:creator>Panda</dc:creator>
    <dc:date>2024-10-22T10:40:31Z</dc:date>
    <item>
      <title>Programatically remove external table completely (Azure)</title>
      <link>https://community.databricks.com/t5/data-engineering/programatically-remove-external-table-completely-azure/m-p/95435#M39102</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I have created external tables with data stored in an Azure storage account.&lt;/P&gt;&lt;P&gt;Is there a way to not only drop the tables but also remove the underlying folder in the storage account which contains the table's data? I want to do this from Databricks in either SQL or Python.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 09:44:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/programatically-remove-external-table-completely-azure/m-p/95435#M39102</guid>
      <dc:creator>johnb1</dc:creator>
      <dc:date>2024-10-22T09:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically remove external table completely (Azure)</title>
      <link>https://community.databricks.com/t5/data-engineering/programatically-remove-external-table-completely-azure/m-p/95454#M39105</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/79252"&gt;@johnb1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can achieve this with the code below. Please review.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;table_name = "table_name"
location = "abfss://container@storage-account.dfs.core.windows.net/path/to/table/data/" 

spark.sql(f"DROP TABLE IF EXISTS {table_name}")
dbutils.fs.rm(location, recurse=True)

########################################
#Note even you can extract location by doing below
df = spark.sql(f"DESCRIBE DETAIL {table_name}")
location = df.select("location").collect()[0]["location"]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 10:40:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/programatically-remove-external-table-completely-azure/m-p/95454#M39105</guid>
      <dc:creator>Panda</dc:creator>
      <dc:date>2024-10-22T10:40:31Z</dc:date>
    </item>
  </channel>
</rss>

