Panda
Valued Contributor

@johnb1 

You can achieve this with the code below. Please review.

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"]