Let’s Get Certified
Module 03 / 20 · Designing data processing systems

Make a clean delivery reproducible

An hourly delivery arrives with two date formats and a repeated invoice. A generated SQL query drops invalid rows. The daily total looks reasonable. Is that enough to release it?

Make a clean delivery reproducible

Write the acceptance rule as a query whose output you can predict. For invoices of 12, 12 and 9 with the first two sharing an ID, determine whether the contract means two unique invoices worth 21 or three valid lines worth 33. A DISTINCT over amounts would silently discard legitimate equal-priced purchases.

In the recording

Review Gemini-generated cleaning SQL, then remove duplicate rows, reconcile date formats and reject invalid trip distances.

Work through the decision

An hourly delivery arrives with two date formats and a repeated invoice. A generated SQL query drops invalid rows. The daily total looks reasonable. Is that enough to release it?

Check your reasoning

Retain the source batch, parse dates explicitly and reconcile counts and amounts against the source. Route rejected rows with a reason. Repeat the transformation on a known fixture and publish only after validation succeeds.

Cert Espresso · 16:53

Decisions and tradeoffs

Quality gate
Check types, keys, ranges and reconciled totals against explicit acceptance criteria before promoting a batch.
Quarantine
Keep the original invalid payload, batch identifier and rejection reason so the producer can correct it and the operator can replay it.
Atomic publish
Stage a complete replacement and commit a validated result as a unit so readers see one coherent version.
Recovery rehearsal
Restore a checkpoint and replay known inputs. Measure both the loss window and time to return to service.

Practice the guide skills

  1. Compare generated cleaning SQL against hand-calculated cases.
  2. Alert on missed completion and failed dependencies.
  3. Restore one batch from retained input.
  4. Choose a commit boundary for related changes.
  5. Validate uniqueness, monetary totals and rejection counts.

Official objectives for this lesson

Related lesson · Move and clean source data under real transfer constraints

Knowledge check

Make a clean delivery reproducible quiz

Answer 3 questions. Check each answer for an explanation.