
Answer-first summary for fast verification
Answer: The entire write operation fails atomically, preventing any data from being committed to the table.
Delta Lake treats `CHECK` constraints as atomic enforcement mechanisms. If any row in a transaction (via `INSERT`, `UPDATE`, `MERGE`, `COPY INTO`, etc.) violates the defined constraint, the entire transaction is rolled back and an error is raised. This ensures strict data integrity by preventing partial or invalid writes. * **Atomicity:** Delta Lake's ACID properties ensure that either the entire batch is committed or none of it is. * **No Silent Failures:** Delta Lake does not silently drop rows or convert them to warnings when a `CHECK` constraint is violated. * **No Automatic Schema Modification:** The engine does not add 'flag' columns or modify the schema to accommodate invalid data.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A Delta Lake table named activity_data includes a CHECK constraint called correct_coordinates to ensure valid geographic ranges (latitude between -90 and 90; longitude between -180 and 180). If a batch write operation attempts to insert a dataset containing at least one record with a longitude of 185, what will be the result of this operation?
A
The write operation succeeds for valid records, but the record with the invalid longitude is silently skipped.
B
The write operation succeeds for all records, and a new boolean column correct_coordinates is added to flag violating rows.
C
The entire write operation fails atomically, preventing any data from being committed to the table.
D
The write operation succeeds for all records, but the violating records are logged as warnings in the driver logs.
E
The operation results in a partial success, where records processed before the violation are committed and the invalid record is moved to a quarantine table.