A data engineer is designing a Delta Live Tables (DLT) pipeline. They need to ensure that records with missing values in the 'customer_id' column are dropped during the ingestion process. Which constraint syntax should be used?
This specific DLT decorator instructs the pipeline to evaluate the expression and drop any rows that return false. It is the correct mechanism for filtering out invalid data silently while allowing the pipeline to continue processing subsequent batches of data without interruption or manual intervention.
Why this answer
The EXPECT DROP VIOLATION constraint is a native DLT feature designed specifically for data quality enforcement. By applying this, the pipeline automatically discards rows that fail the specified predicate while allowing valid records to proceed. This approach is essential in production data engineering to maintain data integrity and prevent downstream errors caused by null values, ensuring only high-quality data enters the silver or gold tables.
Exam trap
Candidates frequently confuse DLT expectations like 'expect_or_drop' with standard Spark SQL filter clauses or constraint keywords from traditional relational databases.