
Answer-first summary for fast verification
Answer: The table reference in the metastore is updated and no data is changed.
The ALTER TABLE ... RENAME TO command in Delta Lake updates the table name in the metastore without altering the underlying data files or their location. This operation does not involve moving data files or creating a new Delta transaction log for the renamed table. It simply changes the table's name in the catalog, making option A the correct answer as it accurately describes the outcome of the rename operation.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
After creating a Delta Lake table with the following query that contains a typographical error:
CREATE TABLE prod.sales_by_stor
USING DELTA
LOCATION "/mnt/prod/sales_by_store"
CREATE TABLE prod.sales_by_stor
USING DELTA
LOCATION "/mnt/prod/sales_by_store"
The following command was executed to correct the table name:
ALTER TABLE prod.sales_by_stor RENAME TO prod.sales_by_store
ALTER TABLE prod.sales_by_stor RENAME TO prod.sales_by_store
What will be the outcome of executing the second command?
A
The table reference in the metastore is updated and no data is changed.
B
The table name change is recorded in the Delta transaction log.
C
All related files and metadata are dropped and recreated in a single ACID transaction.
D
The table reference in the metastore is updated and all data files are moved.
E
A new Delta transaction log Is created for the renamed table.
No comments yet.