The expected behavior when a batch of data containing data that violates the expectation is
processed is that the job will fail. This is because the expectation clause has the ON VIOLATION FAIL
UPDATE option, which means that if any record in the batch does not meet the expectation, the
entire batch will be rejected and the job will fail. This option is useful for enforcing strict data quality
rules and preventing invalid data from entering the target dataset.
Option A is not correct, as the ON VIOLATION FAIL UPDATE option does not drop the records that
violate the expectation, but fails the entire batch. To drop the records that violate the expectation
and record them as invalid in the event log, the ON VIOLATION DROP RECORD option should be used.
Option C is not correct, as the ON VIOLATION FAIL UPDATE option does not drop the records that
violate the expectation, but fails the entire batch. To drop the records that violate the expectation
and load them into a quarantine table, the ON VIOLATION QUARANTINE RECORD option should be
used.
Option D is not correct, as the ON VIOLATION FAIL UPDATE option does not add the records that
violate the expectation, but fails the entire batch. To add the records that violate the expectation and
record them as invalid in the event log, the ON VIOLATION LOG RECORD option should be used.
Option E is not correct, as the ON VIOLATION FAIL UPDATE option does not add the records that
violate the expectation, but fails the entire batch. To add the records that violate the expectation and
flag them as invalid in a field added to the target dataset, the ON VIOLATION FLAG RECORD option
should be used.
Reference:
Delta Live Tables Expectations
[Databricks Data Engineer Professional Exam Guide]