
Answer-first summary for fast verification
Answer: Records that violate the expectation cause the job to fail.
## Explanation The expectation clause `CONSTRAINT valid_timestamp EXPECT (timestamp > '2020-01-01') ON VIOLATION FAIL UPDATE` specifies the `FAIL` action for constraint violations. In Delta Live Tables, there are three main actions for constraint violations: 1. **WARN** (default) - Invalid records are written to the target dataset, and failures are reported as metrics 2. **DROP** - Invalid records are dropped before writing to the target dataset, and failures are reported as metrics 3. **FAIL** - Invalid records prevent the update from succeeding, requiring manual intervention before re-processing Since the constraint uses `ON VIOLATION FAIL UPDATE`, when any record violates the `timestamp > '2020-01-01'` condition, the entire job will fail. This is the most strict enforcement mode where data quality issues must be resolved before processing can continue. **Key Points:** - `FAIL` action causes the pipeline to stop processing - Manual intervention is required to fix the data quality issue - This ensures data integrity by preventing invalid data from entering the target dataset - The job failure will be visible in the Delta Live Tables UI and logs
Author: Keng Suppaseth
Ultimate access to all questions.
No comments yet.
A dataset has been defined using Delta Live Tables and includes an expectations clause: CONSTRAINT valid_timestamp EXPECT (timestamp > '2020-01-01') ON VIOLATION FAIL UPDATE
What is the expected behavior when a batch of data containing data that violates these constraints is processed?
A
Records that violate the expectation are dropped from the target dataset and recorded as invalid in the event log.
B
Records that violate the expectation cause the job to fail.
C
Records that violate the expectation are dropped from the target dataset and loaded into a quarantine table.
D
Records that violate the expectation are added to the target dataset and recorded as invalid in the event log.
E
Records that violate the expectation are added to the target dataset and flagged as invalid in a field added to the target dataset.