Databricks Certified Data Engineer Associate — Question 9

A data engineer is attempting to drop a Spark SQL table my_table. The data engineer 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?

Answer options

Correct answer: C

Explanation

The correct answer is C because external tables in Spark SQL do not delete their data when the table is dropped; only the metadata is removed. Options A and B are irrelevant to the data file's existence, as they pertain to size rather than type. Option D is incorrect because the lack of a location does not define whether the table is external or managed, and option E is wrong as managed tables do delete both data and metadata.