Which of the following describes why the data files still exist and the metadata files were deleted?

A data analyst is attempting to drop a table my_table. The analyst wants to delete all table metadata and data.

They run the following command:

DROP TABLE IF EXISTS my_table;

While the object no longer appears when they run SHOW TABLES, the data files still exist.

Which of the following describes why the data files still exist and the metadata files were deleted?
A . The table’s data was larger than 10 GB
B . The table did not have a location
C . The table was external
D . The table’s data was smaller than 10 GB
E . The table was managed

Answer: C

Explanation:

An external table is a table that is defined in the metastore, but its data is stored outside of the Databricks environment, such as in S3, ADLS, or GCS. When an external table is dropped, only the metadata is deleted from the metastore, but the data files are not affected. This is different from a managed table, which is a table whose data is stored in the Databricks environment, and whose data files are deleted when the table is dropped. To delete the data files of an external table, the analyst needs to specify the PURGE option in the DROP TABLE command, or manually delete the files from the storage system.

Reference: DROP TABLE, Drop Delta table features, Best practices for dropping a managed Delta Lake table

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments