
Explanation:
The correct answer is A: Records that violate the expectation are added to the target dataset and recorded as invalid in the event log.
In Delta Live Tables (DLT), when you define a data quality constraint using only the CONSTRAINT ... EXPECT (condition) clause (without an ON VIOLATION clause), the default behavior is "warn" (also called "retain invalid records").
What happens to violating records?
They are kept (added to the target dataset) along with the valid records. The pipeline does not drop them or fail.
What happens for monitoring/auditing?
DLT records the violation as a data quality metric (number of rows that passed vs. failed the expectation). These metrics, along with details about the violation, are logged in the DLT event log (a Delta table that you can query for pipeline observability).
This is different from the other actions you can explicitly specify:
EXPECT ... ON VIOLATION DROP ROW (or @dlt.expect_or_drop in Python) → Drops the bad records from the target but still logs the count in the event log (this matches option B, but is not the case here because no ON VIOLATION is present).EXPECT ... ON VIOLATION FAIL UPDATE (or @dlt.expect_or_fail) → Causes the update/flow to fail (this matches option C).| Action (default = warn) | SQL Syntax | Result on violation |
|---|---|---|
| warn/retain | EXPECT | Invalid records added to target + logged |
| drop | EXPECT ... ON VIOLATION DROP ROW | Invalid records dropped + logged |
| fail | EXPECT ... ON VIOLATION FAIL UPDATE | Update fails |
Since the question shows only CONSTRAINT valid_timestamp EXPECT (timestamp > '2020-01-01') with no ON VIOLATION clause, it uses the default "warn" behavior → Answer A.
Always check the exact syntax in DLT questions:
EXPECT = keep + log (warn).ON VIOLATION DROP ROW = drop + log.ON VIOLATION FAIL UPDATE = fail the update.This is a common exam trap—many candidates assume expectations are strict by default, but they are non-blocking unless you explicitly tell DLT otherwise.
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')
CONSTRAINT valid_timestamp EXPECT (timestamp > '2020-01-01')
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 added to the target dataset and recorded as invalid in the event log.
B
Records that violate the expectation are dropped from the target dataset and recorded as invalid in the event log.
C
Records that violate the expectation cause the job to fail.
D
Records that violate the expectation are added to the target dataset and flagged as invalid in a field added to the target dataset.
E
Records that violate the expectation are dropped from the target dataset and loaded into a quarantine table.