nerdexam
Databricks

DATABRICKS-CERTIFIED-DATA-ENGINEER-ASSOCIATE · Question #4

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 correct answer is C. The table was external. In Spark SQL, there are two types of tables: managed and external. When you DROP a managed table, both metadata and underlying data files are deleted. When you DROP an external table, only the metadata is removed from the metastore - the actual data files at the external…

Submitted by obi.ng· Apr 18, 2026Data Management

Question

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?

Options

  • AThe table's data was larger than 10 GB
  • BThe table's data was smaller than 10 GB
  • CThe table was external
  • DThe table did not have a location
  • EThe table was managed

How the community answered

(35 responses)
  • B
    3% (1)
  • C
    94% (33)
  • D
    3% (1)

Explanation

In Spark SQL, there are two types of tables: managed and external. When you DROP a managed table, both metadata and underlying data files are deleted. When you DROP an external table, only the metadata is removed from the metastore - the actual data files at the external location are left intact. Since the metadata was deleted (table no longer appears in SHOW TABLES) but the data files still exist, this is the behavior of an external table. The data size (options A/B) is irrelevant to DROP behavior, and 'no location' would imply a managed table.

Topics

#Spark SQL#External Tables#Managed Tables#DROP TABLE

Community Discussion

No community discussion yet for this question.

Full DATABRICKS-CERTIFIED-DATA-ENGINEER-ASSOCIATE Practice