CERTIFIED-DATA-ENGINEER-PROFESSIONAL · Question #59
A Delta Lake table was created with the below query: Realizing that the original query had a typographical error, the below code was executed: ALTER TABLE prod.sales_by_stor RENAME TO…
The correct answer is A. The table reference in the metastore is updated and no data is changed. In Databricks/Delta Lake, renaming a table with ALTER TABLE ... RENAME TO is purely a metadata operation. Only the entry in the metastore (Hive Metastore or Unity Catalog) is updated to point to the new table name. The underlying data files and Delta transaction log remain at…
Question
A Delta Lake table was created with the below query:
Realizing that the original query had a typographical error, the below code was executed:
ALTER TABLE prod.sales_by_stor RENAME TO prod.sales_by_store Which result will occur after running the second command?
Options
- AThe table reference in the metastore is updated and no data is changed.
- BThe table name change is recorded in the Delta transaction log.
- CAll related files and metadata are dropped and recreated in a single ACID transaction.
- DThe table reference in the metastore is updated and all data files are moved.
- EA new Delta transaction log Is created for the renamed table.
How the community answered
(38 responses)- A89% (34)
- B5% (2)
- C3% (1)
- D3% (1)
Explanation
In Databricks/Delta Lake, renaming a table with ALTER TABLE ... RENAME TO is purely a metadata operation. Only the entry in the metastore (Hive Metastore or Unity Catalog) is updated to point to the new table name. The underlying data files and Delta transaction log remain at their original storage path - no files are moved, copied, or recreated. This makes the rename operation fast and safe. Option B is partially misleading - while Delta does track schema evolution in its transaction log, a simple rename updates the metastore, not the Delta log itself. Options C and D are incorrect: no files are dropped, recreated, or moved. Option E is incorrect: the existing Delta log continues to be used unchanged.
Topics
Community Discussion
No community discussion yet for this question.