QuestionQ139

VerifiedData Governance & Quality

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?

Explanation

When dropping an external table, Spark SQL removes only the metadata (schema, table reference) but leaves data files untouched because external tables are defined over data managed outside the catalog. Managed tables, by contrast, store data under catalog control and would delete both metadata and data.

Community Discussion

No comments yet. Be the first to start the discussion!