Databricks Data Engineer Associate Question 257
Select 2You are tasked with creating a managed table in Databricks to store customer transaction data. Which of the following steps must you follow to create the managed table successfully?
- A
Write a SQL query using the CREATE TABLE statement without specifying a LOCATION clause.
- B
Ensure the table's data and metadata are stored within Databricks' managed storage.
- C
Specify a LOCATION clause to point to an external storage path during the CREATE TABLE statement.
- D
Delete the underlying data files manually if the table is dropped.
- E
Use Databricks File System (DBFS) to directly write data into the managed table's storage location.
Show answer and explanation
Correct answers: A, B
Explanation
To create a managed table in Databricks, you must use the CREATE TABLE statement without specifying a LOCATION clause. Databricks will automatically manage the table's data and metadata in its internal storage. Managed tables provide ease of use by handling underlying storage details and ensuring that both data and metadata are deleted when the table is dropped.
- A. Correct.
This is correct. When creating a managed table in Databricks, the CREATE TABLE statement should not include a LOCATION clause. Omitting the LOCATION clause ensures Databricks manages both the data and metadata automatically.
- B. Correct.
This is correct. In a managed table, Databricks automatically handles the storage of both data and metadata in its managed storage, making it easier for users to create and manage tables.
- C. Incorrect.
This is incorrect. Specifying a LOCATION clause is required only for external tables, not for managed tables. Including a LOCATION clause will create an external table instead of a managed table.
- D. Incorrect.
This is incorrect. When a managed table is dropped, Databricks automatically deletes the underlying data files along with the metadata. Manual deletion is not required.
- E. Incorrect.
This is incorrect. While DBFS can be used for writing data, direct writing to a managed table's storage path is not recommended or necessary. Managed tables abstract these details for users.