
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 is stored in the default location managed by Spark/Databricks.
External Tables: When you drop an external table, only the metadata (table definition) is deleted. The underlying data files remain intact in their original location. This is because external tables reference data stored outside of Spark's control.
In this scenario:
SHOW TABLES → metadata was deleted ✓Why other options are incorrect:
Additional Note: To completely remove data from an external table, you need to:
DROP TABLE IF EXISTS my_tabledbutils.fs.rm() or directly from the storage system).