Databricks Certified Data Engineer Associate — Question 54
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?
Answer options
- 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.
Correct answer: C
Explanation
The correct answer is C because the expectation clause specifically states that records violating the constraint will be dropped. Options A and D are incorrect as they suggest that the job fails or that invalid records are added to the dataset, which contradicts the behavior defined in the expectation. Option B is also incorrect since it implies that invalid records are flagged instead of being dropped.