Search code examples
databricksazure-databricks

Databricks delete managed tables from Unity Catalog and File system


According Databricks documentation deleting managed table will delete also all files and folders from the file system. If I want to delete managed table using %sql drop catalog.schema.tablename, table is deleted from the Unity Catalog. But I can till see delta files and folders in ADLS storage. I think those files and folders should be deleted together with the table from Unity Catalog. Any advice what is wrong here?

Delta table I want to delete: enter image description here

Files I can still see in the ADLS gen2 where is metastore located: enter image description here


Solution

  • It will delete the "actual" data files in 30 day (which is the default Delta Log retention day).

    Or, you can also manually delete the data files by running VACCUM against it.

    https://docs.databricks.com/en/delta/history.html#configure-data-retention-for-time-travel-queries