A county assessor parcel desk must stop tickets where closed_at is earlier than opened_at. Which quality step best addresses that?
Select an answer to reveal the explanation.
Short Explanation
A ticket that closes before it opens is a broken clock, not a deep insight. Put a consistency gate on the timeline and flag or reject those rows. Averaging the times or shuffling them just hides the quality bug.
Full Explanation
Logical consistency checks are core data-quality gates for civic event tables: closed_at must not precede opened_at on assessor or service tickets. Adding a check that rejects or flags rows where closed_at precedes opened_at stops impossible timelines from flowing into duration metrics, SLA calculations, and public dashboards. Flagging preserves the bad rows for remediation while rejection may be appropriate when downstream systems cannot tolerate invalid intervals.
Ignoring timestamp order because "databases always store times correctly" confuses storage success with semantic validity; ETL and manual entry routinely invert stamps. Swapping the two timestamps randomly whenever they look suspicious is nondeterministic vandalism and can manufacture new false intervals. Averaging opened_at and closed_at into a midpoint and deleting both destroys the interval entirely and hides the quality defect instead of fixing root causes.
Exam caveat: timezone normalization and daylight-saving transitions can create apparent inversions; standardize to UTC (or a single local zone) before the consistency predicate. Operational check: run the check on historical tickets, quantify inversion rate by source system, quarantine offenders, and recompute open-to-close durations only on rows that pass the gate.