Databricks Data Engineer Professional Question 167
Select 2You are designing a Delta Lake pipeline to process customer transaction data. The team requires strict enforcement of data quality to ensure no null values exist in critical fields (e.g., 'transaction_id'). Additionally, they want the ability to track and audit data quality issues without interrupting the pipeline's execution. Which combination of Delta Lake features should you use to meet these requirements?
- A
Implement Delta Lake constraints such as NOT NULL during table creation to enforce schema-level checks.
- B
Use Delta Lake's
MERGE INTOoperation to validate and reject invalid records during data ingestion. - C
Leverage Delta Lake's
expectationsfeature to define data quality rules and log violations for auditing. - D
Enable Delta Lake's Change Data Feed (CDF) to track changes in data quality over time.
- E
Set up a streaming query checkpoint to capture and reject records that violate quality rules.
Show answer and explanation
Correct answers: A, C
Explanation
To enforce data quality and track issues without interrupting pipeline execution, Delta Lake's constraints like NOT NULL ensure schema-level checks, and expectations allow for flexible rule definition and auditing. These approaches complement each other by enforcing strict rules where necessary while still providing visibility into violations for auditing purposes.
- A. Correct.
Delta Lake constraints such as NOT NULL enforce strict schema-level data quality checks and prevent records with null values in critical fields from being written to the table. This is a suitable approach for enforcing strict data quality requirements.
- B. Incorrect.
The
MERGE INTOoperation is used to merge datasets, not primarily to validate or reject invalid records. It is not designed for enforcing schema-level constraints or tracking quality issues. - C. Correct.
Delta Lake's
expectationsfeature allows you to define data quality rules, monitor compliance, and log violations without interrupting pipeline execution. This aligns with the requirement for auditing data quality issues. - D. Incorrect.
Delta Lake's Change Data Feed (CDF) is used to track data changes (inserts, updates, and deletes) over time. It is not specifically designed for monitoring or enforcing data quality rules.
- E. Incorrect.
Streaming query checkpoints are used for fault tolerance in streaming pipelines and do not inherently enforce or track data quality rules.