Databricks Data Engineer Professional · Section 6 · 8% of the exam
Implement a data purging strategy that satisfies data retention and deletion policies (e.g., GDPR right-to-erasure, GDPR right-to-be-forgotten deletion) using Delta Lake and Unity Catalog features.
One of the objectives of the Databricks Certified Data Engineer Professional exam, in the section “Ensuring Data Security and Compliance”. Here is what it covers, the points to remember and a question to try.
What it covers
Protecting personal data means choosing the right de-identification technique, applying it at write time or read time, detecting PII as batch and streaming data arrives, and erasing a person completely from Delta tables, their history and every downstream copy.
Points to remember
- Pseudonymised data (salted hash, token, ciphertext) is still personal data under the GDPR; anonymised data is not, and usually needs generalisation plus suppression.
- Hashing:
sha2(concat(secret_salt, value), 256)keeps joins; an unsalted hash of an email is guessable. Tokenisation: random token plus a restricted vault, reversible by compliance. - Generalisation lowers precision (
year(), decade buckets,left(postcode, 3),date_trunc); suppression removes values;ai_mask(Public Preview) redacts entities in free text. - Write-time de-identification creates a safer copy; read-time column masks or ABAC policies decide per reader, with one tiered UDF.
- Data Classification scans tables, streaming tables and materialized views incrementally; with auto-tagging it applies
class.*tags that ABAC policies can match.
Try a question
A Structured Streaming job reads prod.crm.users_bronze with spark.readStream.table(...) and appends to prod.crm.users_silver. After the GDPR job deletes rows from bronze, the stream fails because its source is no longer append-only. Which change keeps the stream running while still honouring the erasure?
- ARun a full refresh of the silver table after every GDPR delete so the stream restarts from the current state
- BSet the
ignoreChangesoption on the read and accept that the deleted users remain in the silver table - CSet
skipChangeCommitson the read and delete the same users from the silver table with DML - DSwitch the stream to
trigger(availableNow=True)so that it processes the delete commits as a batch
Show the answer
C. skipChangeCommits makes the stream ignore commits that delete or update existing rows, so the GDPR delete on bronze no longer breaks it. Because those commits are skipped, the erasure must be applied downstream separately with DELETE or MERGE. A full refresh reprocesses everything and can lose data whose upstream source has expired.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Anonymisation, PII Pipelines and GDPR Erasure teaches this objective (about 60 minutes), and 16 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.
More in this section
- Apply least-privilege access control lists (ACLs) to secure Unity Catalog securable objects and workspace resources.
- Apply attribute-based access control (ABAC) policies with governed tags to enforce row filters and column masks at scale.
- Apply anonymization and pseudonymization methods — such as hashing, tokenization, suppression, and generalization — to confidential data (e.g., using column masks and related Unity Catalog features).
- Implement a compliant data pipeline that enforces PII detection and masking controls across batch and streaming workloads using Unity Catalog features.