Databricks Data Engineer Associate Question 245
Select 3You are working on a Databricks project where you need to decide between creating a managed table or an external table to store your data. Which of the following statements correctly describe the differences between managed and external tables?
- A
When a managed table is dropped, Databricks deletes both the metadata and the underlying data.
- B
External tables require the user to manage the underlying storage location and Databricks only manages the metadata.
- C
Managed tables offer better performance compared to external tables for all workloads by default.
- D
Dropping an external table only removes the metadata from the metastore but does not delete the underlying data.
- E
Managed tables can only be created using Delta Lake, while external tables can use any format.
Show answer and explanation
Correct answers: A, B, D
Explanation
The primary difference between managed and external tables lies in how the data and metadata are managed. Managed tables are fully controlled by Databricks, including the deletion of underlying files when the table is dropped. External tables, on the other hand, rely on the user to manage the storage, and only the metadata is removed when the table is dropped. It is important to understand these distinctions to choose the right table type based on the project requirements.
- A. Correct.
Correct: For managed tables, Databricks handles both the metadata and the underlying data. When the table is dropped, the associated data files are also deleted.
- B. Correct.
Correct: For external tables, the user is responsible for specifying and managing the storage location, while Databricks manages only the metadata.
- C. Incorrect.
Incorrect: Performance is workload-specific and not inherently better for managed tables compared to external tables. Other factors like file format and query optimization also play a role.
- D. Correct.
Correct: Dropping an external table only removes the metadata entry from the metastore but does not affect the underlying data files in the storage location.
- E. Incorrect.
Incorrect: Managed tables can use various file formats, including Delta Lake, Parquet, and others. Similarly, external tables can also use multiple file formats.