
Answer-first summary for fast verification
Answer: The SQL statement will result in an error and the Delta table will not be created.
The query will result in an error because the `_change_type` column is reserved for Change Data Capture (CDC). The error message will be: ``` Error in SQL statement: DeltaIllegalStateException: Unable to enable Change Data Capture on the table. The table already contains reserved columns [_change_type] that will be used internally as metadata for the table’s Change Data Feed. To enable Change Data Feed on the table rename/drop these columns. ``` This means the Delta table cannot be created as is because of the conflict with reserved column names required for CDC functionality.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A data engineer is creating a Delta table with the following SQL query:
CREATE TABLE data_changes (_change_type STRING, _changed_by STRING)
TBLPROPERTIES (delta.enableChangeDataFeed = true);
CREATE TABLE data_changes (_change_type STRING, _changed_by STRING)
TBLPROPERTIES (delta.enableChangeDataFeed = true);
What will be the outcome of executing this query?
A
The Delta table will be created successfully with the Change Data Feed enabled.
B
The SQL statement will result in an error and the Delta table will not be created.
C
The Delta table will be created successfully but Change Data Feed will not be enabled.
D
The Delta table will be created successfully but the _change_type column will be removed.
E
The SQL statement will not return any error but the Delta table will not be created.