# The current daily_revenue pipeline computes today only, runs once a night, and freezes each day's nu

Canonical URL: <https://datadriven.io/problems/the-current-dailyrevenue-pipeline-computes-today-only-runs-aff7ca4b>

Domain: Pipeline Design · Difficulty: medium

## Problem

The current daily_revenue pipeline computes today only, runs once a night, and freezes each day's number forever. A late mobile event from five days ago arrives today and lands nowhere because the pipeline never looks back. The section's simplest workable fix is the seven-day rerun window: every morning, recompute the last seven days, not just today. The pattern requires three things: an idempotent write (re-running produces the same answer, not duplicates), partition-level overwrite by event_date (yesterday's row gets replaced, not added to), and source data retained for at least the window length. Set the rerun window: add an orchestrator that schedules a daily run with a seven-day rerun window in its name, and replace the destination with a lakehouse format whose partition overwrite makes the rerun idempotent.

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/the-current-dailyrevenue-pipeline-computes-today-only-runs-aff7ca4b)
- [System Design Interview Questions](https://datadriven.io/data-engineering-system-design)
- [Data Engineering Interview Prep Guide](https://datadriven.io/data-engineer-interview-prep)
- [Daily Challenge](https://datadriven.io/daily)

---

Source: DataDriven (https://datadriven.io). 100% free data engineering interview prep. Live code execution against Postgres 16, Python 3.11, and Spark sandboxes. No paywall, no premium tier, no signup gate.