Published Nov 16, 2026 ⦁ 10 min read
CCPA Deletion Requests in Databricks Lakehouses

CCPA Deletion Requests in Databricks Lakehouses

A successful Databricks DELETE does not mean a consumer’s data is gone. It removes current rows, but older files, exports, and backups need separate cleanup.

A CCPA deletion workflow must cover five steps:

  • Confirm the request: Verify identity, assign owners, and document any lawful reasons to retain data.
  • Find the data: Map consumer identifiers across source tables, derived data, historical versions, and separate copies.
  • Delete and prevent return: Remove matching rows, update affected outputs, and stop ingestion or restores from bringing the data back.
  • Clean up retained copies: Use REORG and VACUUM where needed, then address logs, exports, and backups through their own cleanup processes.
  • Verify and report: Check each location, record results, and track unfinished work with owners and deadlines.

Acknowledge requests within 10 business days and generally respond within 45 calendar days of receipt. Retention settings do not create a legal exception - and zero matches in current queries do not prove complete erasure.

CCPA Deletion Workflow for Databricks Lakehouses

CCPA Deletion Workflow for Databricks Lakehouses

2. Find Consumer Data and Copies

Inventory Sources, Tables, and Destinations

Map every current location and retained copy before deleting anything. Tie the inventory to the request ID. Record the identifiers searched, systems checked, findings, and owners. This rigorous documentation is a hallmark of those who master data engineering at a professional level.

Include source systems, raw files, Delta tables, materialized views, feature tables, extracts, caches, and exports. Also track streaming checkpoints, state stores, change data feed (CDF) consumers, replay windows, and target tables.

Record Matching Rules and Data Owners

Resolve identity links before choosing deletion predicates. Keep confirmed matches, uncertain matches, and nonmatches separate. Check historical IDs, guest orders, merged accounts, and shared household identifiers.

Document how you normalize email addresses, but don't assume a shared or reused email belongs to one person. The table below records the inventory, matching rules, owners, dependencies, and retention context.

Hypothetical retailer inventory

Dataset and table name Storage location Personal-information columns Consumer key and matching logic Data owner Downstream copies Retention policy Deletion exception
bronze.orders s3://northstar-lake/bronze/orders/ customer_id, shipping address Exact customer_id = C-104582; verify order-account map Commerce data engineering silver.orders, fraud pipeline, daily object-storage backup 30 days in bronze Possible legal-claim hold; legal review required
silver.customer_profile Managed Delta table customer_sk, email, phone Map C-104582 → 882194; exact surrogate-key match Customer data team gold.customer_360, CRM export, weekly warehouse snapshot 7-year tax-related order records may apply Retain only information reasonably necessary for a legal or tax obligation
gold.customer_360 Managed Delta table customer_sk, segments, preferences Exact customer_sk = 882194 Analytics engineering BI semantic model, dashboards, BI extract, DR copy 90 days None identified
crm_weekly_export s3://northstar-exports/crm/ Email, loyalty ID, segment Match loyalty ID and email mapping Marketing operations CRM vendor, vendor-managed backup 14 days Vendor deletion confirmation required

Confirm retention rules and exceptions with legal, records-management, and system owners. Don't infer them from table properties. CCPA exceptions can include legal obligations, legal claims, security practices, certain compatible internal uses, and specified exempt information.

Trace Lineage and Table History

Matching rules identify the right rows. Lineage shows where those rows traveled. Once you've mapped the copies, verify how each table was produced and retained.

Use Unity Catalog lineage as a starting point - not proof that you've found everything. Check pipeline definitions, notebooks, SQL, scheduled jobs, and storage inventories, then get owner confirmation. Distinguish live dashboard queries from stored extracts, and shallow clones from deep clones. Deleting from a source table doesn't remove separately stored copies or clones.

Run DESCRIBE HISTORY for each affected Delta table. Record its current version, relevant prior versions, clone relationships, and, after execution, the deletion version.

Also record delta.deletedFileRetentionDuration, delta.logRetentionDuration, and checkpoint paths. Time travel depends on retained logs and data files. Because VACUUM skips directories beginning with _, checkpoint cleanup needs a separate step.

3. Delete Current Rows and Update Derived Data

Check Keys and Run Parameterized DELETE

Once you’ve mapped the affected tables and copies, delete the current rows first. Check the key, data type, null handling, duplicate behavior, and any approved retention exception. Preview the match count, then run a parameterized DELETE with a named bind variable. Reject missing, ambiguous, or unapproved identifiers. Never concatenate request input into SQL. Without a WHERE clause, the command deletes every row.

SELECT COUNT(*)
FROM main.silver.customer_orders
WHERE customer_id = :consumer_id;

DELETE FROM main.silver.customer_orders
WHERE customer_id = :consumer_id;

Record the approved predicate, preview count, and approval reference. Treat each table as a separate transaction unless multi-table support is enabled. Save a checkpoint for each table with its status, execution time, and affected-row counts. Use the same predicate for retries, and investigate count mismatches.

If a table fails, keep successful checkpoints, alert the data-protection owner, and review before resuming. Coordinate ingestion gates and source watermarks so new writes cannot invalidate the preview or bring deleted rows back.

Update Derived Data and Block Reingestion

Use DELETE for directly matched derived rows or MERGE to synchronize targets with an approved deletion manifest. Use a controlled rewrite when personal information sits inside aggregates, arrays, feature vectors, denormalized documents, or files that cannot be safely removed with a row predicate.

Recompute consumer-linked aggregates and features from clean inputs. Do not automatically delete non-personal aggregate metrics. Refresh affected caches and materialized views. Send downstream owners the request ID, required action, deadline, and evidence requirements.

Then stop upstream jobs from recreating the deleted data. If replay protection needs a suppression record, keep only an approved, minimized identifier with access controls and a defined expiration - not a copy of the deleted profile.

Verify Current Rows and Purge Deletion Vectors

Before file cleanup, verify that deleted current rows stay gone. Rerun the approved count query and confirm zero current matches for rows in scope. Check derived outputs and recent ingestion for reappearance. Record table names, job version, execution ID, timestamp in U.S. format with time zone, and available affected-row counts. Label unavailable metrics rather than guessing.

For deletion-vector-enabled tables, rows can remain in Parquet files while staying hidden from queries. When physical removal is required, pause writes, run the rewrite below, and confirm completion.

REORG TABLE main.silver.customer_orders APPLY (PURGE);

REORG does not erase obsolete files. Schedule eligible VACUUM cleanup only after the approved retention interval has elapsed, measured from the rewrite that made those files obsolete. The default retention is commonly 7 days. Do not shorten it without reviewing readers, recovery needs, and policy.

Tech Talk | Addressing GDPR and CCPA Scenarios with Delta Lake and Apache Spark™

4. Purge Retained Files and Separate Copies

After DELETE and REORG, purge obsolete files and any remaining separate copies.

Schedule VACUUM With Safe Retention

Treat delta.deletedFileRetentionDuration, delta.logRetentionDuration, and the VACUUM retention threshold as separate controls. Common defaults are 7 days for data files and 30 days for logs. Delta retention and checkpoint processing govern log cleanup - not VACUUM. Check runtime compatibility before changing either property.

Schedule cleanup based on the approved retention policy and the operation that made files obsolete - not the object store’s file modification time. Record the deletion or rewrite completion time, table version, retention setting, and legal hold status. Get approval with retention safeguards enabled, and don't use zero-hour retention as a shortcut. Link each cleanup action to the request ID and deletion version.

Before running these commands, confirm that 168 hours meets policy and exceeds the longest expected reader or writer duration, streaming job, clone, recovery process, or regulated investigation. Review dry-run candidates with the table owner, storage owner, privacy lead, and platform administrator. 168 hours is neither a CCPA deadline nor universally safe.

VACUUM main.silver.customer_orders RETAIN 168 HOURS DRY RUN;

Run the next command only after completing those checks and documenting approval:

VACUUM main.silver.customer_orders RETAIN 168 HOURS;

Compare Deletion and Retention Methods

Use this comparison to check what each mechanism removes - and what you still need to verify.

Mechanism or surface Purpose Effect and limitation Verification
DELETE Remove matching current rows Updates current state; historical files or soft-deleted data may remain Query current rows and inspect available operation metrics
REORG TABLE ... APPLY (PURGE) Rewrite files containing supported soft-deleted data Removes soft-deleted data from replacement files; obsolete originals still need eligible cleanup Inspect rewrite results and subsequent file-cleanup evidence
VACUUM Remove eligible obsolete data files Removes files beyond the retention threshold; independent copies remain Review cleanup results and storage-owner confirmation
Time travel Read historical table versions May expose deleted information while required history and files remain Test relevant historical queries with authorized access
Backups and snapshots Support recovery Follow separate purge or expiration procedures Obtain backup-owner disposition evidence
Downstream copies Support derived processing and delivery Require separate deletion, refresh, or documented retention decisions Query destinations and collect owner confirmations

Handle Logs, Exports, and Backups

Check transaction logs, checkpoints, metadata, file statistics, and change data feeds for identifying or reconstructable data. Follow documented Delta cleanup procedures; never delete log files manually. Account for versioning, soft delete, and immutability: deleting the current object may leave retained versions intact. A successful VACUUM confirms file cleanup, not complete erasure.

Technical retention is not a legal basis for delay. Get legal approval for any exception or delayed backup deletion. For storage with versioning or soft delete, remove eligible object versions and delete markers through the provider’s approved process.

For immutable or offline backups, restrict access, document the backup expiration date, and schedule a purge or expiry action. The restoration runbook must replay the deletion request before restored data becomes queryable again. Keep backup-owner disposition evidence, and distinguish removed files from copies awaiting expiration or retained for legal reasons.

Carry these request IDs and disposition records into the final verification step.

5. Verify Deletion and Close the Request

Check Current Data, History, and Copies

Once delete, rewrite, and vacuum jobs finish, verify every affected surface using the same request ID and approved match rule. Query each affected Delta table and downstream destination again. Record row counts, query timestamps, table versions, and owner confirmations. Zero matches in current reads do not prove complete erasure.

After the retention window expires, check historical versions using rewrite records, VACUUM output, storage evidence, and confirmations for exports and backups.

Record Results and Notify the Consumer

Use the verification results to resolve remaining exceptions and downstream tasks. The closeout should show both finished work and work deferred until later.

Keep a restricted evidence record covering checked datasets, minimized predicates, retention settings, purge results, backup disposition, exception grounds, approvers, and timestamps. Label each item as completed, pending retention, pending downstream action, excepted, or unable to verify. Give deferred work an owner and a deadline. Keep request records for at least 24 months, without copying unnecessary personal data into tickets.

Respond within 45 calendar days, or 90 with a permitted extension. Explain unfinished work and applicable exceptions in plain language. Leave out SQL, storage paths, and security details. Successful commands alone do not mean the request is complete. Continue tracking deferred cleanup after sending the response.

Conclusion: Test and Maintain the Deletion Runbook

Test the runbook with synthetic records, using the same matching rules and downstream paths as production. Include historical cleanup, independent copies, retries, failed jobs, and backup restoration.

Confirm that targeted records remain absent after ingestion and restore tests, while unrelated records stay unchanged. Update the runbook whenever tests reveal missed destinations or unclear ownership. Use every miss, delay, or exception to guide those updates.

FAQs

How can I automate deletion across Delta tables and downstream copies?

Use metadata-driven jobs that read PII and retention tags from the catalog to trigger deletion when retention deadlines are met and legal-hold conditions permit it. Cover source Delta tables, downstream copies and exports, historical remnants, backups, and replicas.

Deleted Delta rows remain queryable through time travel until a purge step, such as VACUUM, removes the retained files. For audit evidence, log the affected records, trigger rule, timestamp, and row-count/checksum verification for each run.

What if backup retention exceeds the CCPA response deadline?

If backup retention extends beyond the CCPA deletion response deadline, wait until retention ends to physically delete the data from backups. Before the deadline, delete the data or make it inaccessible anywhere it can be actively queried.

Log the request, mark the records as deleted, and confirm that access is blocked in governed copies and downstream datasets. Keep audit evidence of these steps until the final backup purge.

How can I verify erasure without retaining unnecessary personal data?

Confirm that the retention period has ended and no legal holds apply. Then purge source tables, derived tables, exports, and historical file versions according to your lakehouse retention policy.

Verify deletion with row counts or checksums. Check that sensitive records can no longer be queried - even through recovery features. Keep an immutable audit trail that includes execution and query IDs, target tables, and purged record counts.