
Answer-first summary for fast verification
Answer: The table was external
The question describes a scenario where dropping a table removes metadata but leaves the data files intact. In Databricks, this behavior specifically occurs with external tables. External tables are defined with data stored in an external location outside of Databricks' default managed storage. When a DROP TABLE command is executed on an external table, only the table metadata (schema, table definition) is removed from the metastore, while the actual data files remain in their external storage location. This is by design to prevent accidental data loss. The community discussion confirms this with 100% consensus on option C, with comments explaining that external tables only remove metadata while preserving underlying data files. Other options are incorrect: table size (A/D) doesn't affect DROP TABLE behavior, lack of location (B) would prevent table creation, and managed tables (E) would delete both metadata and data.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A data analyst is attempting to drop a table named my_table to delete both its metadata and data. They execute the following command:
DROP TABLE IF EXISTS my_table;
DROP TABLE IF EXISTS my_table;
After this command, the table no longer appears in the output of SHOW TABLES. However, the underlying data files still exist, while the metadata files have been deleted.
Why do the data files persist after the metadata files have been removed?
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