A gold dataset in a Lakeflow Spark Declarative Pipelines pipeline declares the expectation below. Tonight's update reads a batch in which one record carries a negative revenue value. What is the effect on the update and on the published table?
CONSTRAINT non_negative_revenue EXPECT (revenue >= 0) ON VIOLATION FAIL UPDATE- AThe update fails, so the table keeps the contents it held before the run, and a further update succeeds only once the source data or the expectation itself has been corrected. Correct
- BThe violating record is discarded, the remaining records are published, and the pipeline is reported as degraded until an engineer acknowledges the warning in the interface.
- CThe update runs to completion and the violating record is published with the rest of the batch, while the failure count is raised against the named expectation.
- DThe violating record is held back in pipeline state and published automatically during a later update, once a corrected revenue value for that record arrives.
Why A is correct: Correct. FAIL UPDATE treats a violation as fatal, so nothing from that update is published and the previous state of the table stands.
Why B is wrong: Discarding the record is the DROP ROW action, and there is no degraded state to acknowledge; FAIL UPDATE is deliberately stronger than either of those.
Why C is wrong: This is what an expectation with no action clause does; adding ON VIOLATION FAIL UPDATE is precisely the instruction not to publish data that breaks the rule.
Why D is wrong: No holding area for rejected records exists; a record kept for later inspection has to be routed to a quarantine dataset that the author declares.