# A daily aggregation task on the canvas hardcodes CURRENT_DATE in its SQL and is bypassed by a custom

Canonical URL: <https://datadriven.io/problems/a-daily-aggregation-task-on-the-canvas-hardcodes-currentdat-04dc7736>

Domain: Pipeline Design · Difficulty: medium

## Problem

A daily aggregation task on the canvas hardcodes CURRENT_DATE in its SQL and is bypassed by a custom Python backfill loop that submits 365 queries at once. The destination is plain Snowflake INSERT INTO append. Apply the backfill framing this section just taught and make the pipeline backfillable structurally. (1) Add an orchestrator (Airflow, Dagster, or Prefect) that owns the backfill operation as a first-class scheduled job, replacing the custom Python loop. (2) Replace the plain Snowflake destination with a lakehouse format (Iceberg, Delta, or Hudi) whose ACID transactions support partition overwrite during backfill, so each historical day's run replaces only its own partition.

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/a-daily-aggregation-task-on-the-canvas-hardcodes-currentdat-04dc7736)
- [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.