
Ultimate access to all questions.
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?
A
The table's data was larger than 10 GB
B
The table's data was smaller than 10 GB
C
The table was external
D
The table did not have a location
E
The table was managed
Explanation:
In Databricks/Spark SQL, there are two types of tables:
Managed Tables: When you drop a managed table, both the metadata (table definition) AND the underlying data files are deleted. The data files are stored in a managed location controlled by Spark/Databricks.
External Tables: When you drop an external table, only the metadata (table definition) is deleted, while the underlying data files remain intact. This is because external tables reference data stored in an external location (like S3, ADLS, etc.) that is not managed by Spark/Databricks.
In this scenario:
SHOW TABLES → metadata was deletedKey points:
Therefore, the correct answer is C. The table was external.