QuestionQ171

VerifiedData Transformation, Cleansing, and Quality

The data engineering team maintains a table of aggregate statistics using nightly batch updates. It contains total sales for the preceding day, together with totals and averages for several periods, including the prior 7 days, year-to-date, and quarter-to-date. The table is called store_saies_summary and has the following schema:

Question Image

The daily_store_sales table contains all information required to update store_sales_summary. Its schema is: store_id INT, sales_date DATE, total_sales FLOAT.

If daily_store_sales is implemented as a Type 1 table and its total_sales column can be adjusted after manual data auditing, which approach is safest for generating accurate reports in the store_sales_summary table?

Explanation

A full batch aggregation from the current daily_store_sales state recalculates every rolling, quarter-to-date, and year-to-date value after Type 1 corrections overwrite historical sales. Replacing the summary table with that complete result avoids stale totals or averages caused by previously aggregated values. Delta streaming reads ordinarily process append inputs and fail when source UPDATE, DELETE, MERGE, or OVERWRITE operations occur unless explicit change-handling logic is used.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!