
Ultimate access to all questions.
A dataset has been defined using Delta Live Tables and includes an expectations clause: CONSTRAINT valid_timestamp EXPECT (timestamp > '2020-01-01') ON VIOLATION DROP ROW
What is the expected behavior when a batch of data containing data that violates these constraints is processed?
A
Records that violate the expectation cause the job to fail.
B
Records that violate the expectation are added to the target dataset and flagged as invalid in a field added to the target dataset.
C
Records that violate the expectation are dropped from the target dataset and recorded as invalid in the event log.
D
Records that violate the expectation are added to the target dataset and recorded as invalid in the event log.
Explanation:
The correct answer is C because:
ON VIOLATION DROP ROW clause explicitly specifies that rows violating the constraint should be dropped from the target dataset.
In Delta Live Tables, when using expectations with ON VIOLATION DROP ROW, the violating records are:
Let's analyze why other options are incorrect:
ON VIOLATION DROP ROW handles violations gracefully by dropping rows rather than failing the pipeline.DROP ROW clause.Key Points:
ON VIOLATION DROP ROW: Drops violating rows and logs themON VIOLATION FAIL UPDATE: Fails the pipeline when violations exceed a thresholdThis behavior ensures data quality while maintaining pipeline resilience by handling invalid data gracefully rather than failing the entire job.