
Explanation:
When you execute ALTER TABLE ... RENAME TO on a Delta Lake table, it is a metadata-only operation. The pointer in the metastore (Hive Metastore or Unity Catalog) is updated to the new table name, but the underlying data files stay exactly where they were originally stored.
Ultimate access to all questions.
A data engineer creates a Delta Lake table with the following SQL command:
CREATE TABLE dev.my_table
USING DELTA
LOCATION "/mnt/dev/my_table";
CREATE TABLE dev.my_table
USING DELTA
LOCATION "/mnt/dev/my_table";
Later, the engineer decides to rename the table for shared use by executing:
ALTER TABLE dev.my_table RENAME TO dev.our_table;
ALTER TABLE dev.my_table RENAME TO dev.our_table;
What is the result of running this ALTER TABLE command?
A
The table reference in the metastore is updated, and all underlying data files are physically moved to a new directory.
B
A new Delta transaction log is initialized for the renamed table, separate from the original.
C
The table reference in the metastore is updated, but the underlying data files remain in their original location.
D
The table name change is recorded exclusively in the Delta transaction log, and the metastore remains unchanged.
E
All related files and metadata are dropped and recreated in a single ACID transaction to reflect the new name.
No comments yet.