Databricks Certified Data Engineer Associate — Question 48
A data engineer is attempting to drop a Spark SQL table my_table and runs the following command:
DROP TABLE IF EXISTS my_table;
After running this command, the engineer notices that the data files and metadata files have been deleted from the file system.
What is the reason behind the deletion of all these files?
Answer options
- A. The table was managed
- B. The table's data was smaller than 10 GB
- C. The table did not have a location
- D. The table was external
Correct answer: A
Explanation
The correct answer is A because managed tables in Spark SQL automatically delete both the data and metadata files upon being dropped. Options B and C are irrelevant as the size of the data or the absence of a specified location do not dictate file deletion. Option D is incorrect because external tables retain their data files even when the table is dropped.