IMEN891K / IDSC501 / AXGS-501 · Data Engineering · Fall 2026

12. Big Data II: Data Warehousing

Sangwoo Mo · POSTECH
Industrial & Management Engineering

Where We Are

PART IPART IIPART IIICollection and PreparationLec 2-5SQLLec 6-8NoSQLLec 9-10Big DataLec 11-13Monitoring and UpdatesLec 14-17

Recap: Batch Results

Input rowsa bounded inputBatch calculationfilter or groupSaved resultanother table
A saved result can serve repeated analysis

Outline: Big Data II

01

Analytical Copies

keep reporting work separate from sales transactions

02

Rows for Analysis

connect each sale to its product and daily total

03

Refreshing Reports

refresh the copy in the right order without counting twice

01 · Analytical Copies

01

Analytical Copies

keep reporting work separate from sales transactions

02

Rows for Analysis

connect each sale to its product and daily total

03

Refreshing Reports

refresh the copy in the right order without counting twice

The Daily Sales Report

October 2total 500October 3total 500Same report tomorrowrefresh the numbers
A report needs a clear date range and one correct total for each date

Sales Transactions

Customer buysone purchaseSales databaserecord one saleReceiptrespond immediately
The operational database records each sale as it happens

An Analytical CopyA data warehouse stores data for repeated analytical queries

Sales databaserecord purchasesReporting tablescopy and organize salesDaily reportread the copy
A data warehouse keeps an organized copy for analysis

Transactions and AnalysisThe same sales data supports different kinds of work

OLTP: record one salerespond to a purchaseAnalytical copyhistory for reportingOLAP: compare salessum by date or product
OLTP records individual purchases; OLAP summarizes and compares many purchases

Warehousing Becomes a ServiceWarehouses organized company data before cloud services managed the infrastructure

1988: warehouse architectureintegrate company data2010: BigQuery previewmanaged analytical serviceThe same analyst questionsales by date and product
Managed services change who operates the system; analysts still define the query

A Managed WarehouseServerless means the service manages the servers for the user

Analystload tables and write SQLManaged warehouseruns the queryExecution resourcesprovider operates servers
The service runs the infrastructure; the analyst defines the tables and query

Copy Freshness

Sale recorded10:05Next copy completes11:00Report includes saleafter 11:00
The report includes only the sales already copied

02 · Rows for Analysis

01

Analytical Copies

keep reporting work separate from sales transactions

02

Rows for Analysis

connect each sale to its product and daily total

03

Refreshing Reports

refresh the copy in the right order without counting twice

Four Sales

sale_idsale_dateproduct_idamount
12025-10-02P1300
22025-10-02P2200
32025-10-03P1400
42025-10-03P2100
October 2 has 300 + 200; October 3 has 400 + 100

A Row Has a MeaningThe grain of fact_sales is one sale

One salesale_id identifies itFour fact rowskeep sale detailTwo daily rowssum by date
Grain means what one row represents

A Sales FactA fact row records one sale and its amount

sale_id3sale_date2025-10-03product_idP1amount400one row = one sale
Sale 3 records 400 for product P1 on October 3

Product Descriptionsdim_product has one row per product

product_idname
P1Chocolate
P2Ice-cream
A dimension gives a description for each product code

Facts and a Dimensionproduct_id connects each sale to one product description

fact_sales: one row per saledim_product: one row per productsale_idproduct_idamount1P13002P22003P14004P2100product_idnameP1ChocolateP2Ice-creamproduct_id links a sale to its product name
Two P1 sales share the same Chocolate description

Names on Sales

SELECT sale_id,name,amount
FROM fact_sales JOIN dim_product USING(product_id)
WHERE sale_date='2025-10-03'
ORDER BY sale_id;
sale_idnameamount
3Chocolate400
4Ice-cream100
The join adds names while keeping one row per sale

A Daily TotalGrouping changes the grain from one sale to one date

SELECT sale_date,SUM(amount) AS total
FROM fact_sales
GROUP BY sale_date ORDER BY sale_date;
sale_datetotal
2025-10-02500
2025-10-03500
Four sale rows become two daily totals

Two Views of the Same SalesChanging the grouping answers a different analytical question

productOctober 2October 3total
Chocolate300400700
Ice-cream200100300
All products5005001000
The same four sales support daily totals and product totals

Detail and Summary

Sale 3: 400P1 is still knownOctober 3: 500400 + 100 combinedProduct breakdown?needs the sale rows
The daily total alone cannot recover the product amounts

Demo: Daily Sales

  1. Sum amount for each sale_date
  2. Keep only product P1 and compare the daily totals
Ctrl/⌘ + Enter
Query result
sale_dateamount
2025-10-02300
2025-10-02200
2025-10-03400
2025-10-03100

Answer: Daily Sales

SELECT sale_date,SUM(amount) AS total
FROM fact_sales
GROUP BY sale_date ORDER BY sale_date;
sale_datetotal
2025-10-02500
2025-10-03500
Each result row is one date, not one sale

Answer: Chocolate Sales

SELECT sale_date,SUM(amount) AS total
FROM fact_sales WHERE product_id='P1'
GROUP BY sale_date ORDER BY sale_date;
sale_datetotal
2025-10-02300
2025-10-03400
The filter changes which sales contribute to each total

03 · Refreshing Reports

01

Analytical Copies

keep reporting work separate from sales transactions

02

Rows for Analysis

connect each sale to its product and daily total

03

Refreshing Reports

refresh the copy in the right order without counting twice

From Received Data to a ReportExtract, transform and load connect the source to analytical tables

Received salespreserve the source rowsSales factsone row per saleDaily totalsone row per date
A pipeline turns received data into the table the report reads

Adding the New Date

datealready in reportnew batch
October 2500—
October 3—500
October 3 contributes one new total of 500

Caveat: Counting a Batch TwiceSuccessful SQL can still produce a wrong report

October 3 total400 + 100 = 500Load the same total twice500 + 500Report total1000: incorrect
Repeating an append can double the same sales

Replace the Affected DateA repeatable load preserves one correct row per date

Choose October 3recompute 400 + 100Replace that dateone row with 500Read the reportOctober 2 remains 500
Replacing the same date twice still leaves one total for that date

Demo: Repeat the Load

  1. Run the supplied date replacement twice in one script
  2. Check that both dates still have one total of 500
Ctrl/⌘ + Enter
Query result
sale_datetotal
2025-10-02500
2025-10-03500

Answer: One Total per Date

dateafter one replacementafter two replacements
October 2500500
October 3500500
Both executions leave the same correct report

A Corrected Sale

October 2 salesale 1: 300Amount correctedsale 1: 350Rebuild October 2350 + 200 = 550
A correction changes the affected date, not every date

The Corrected Report

datebefore correctionafter refreshing October 2
October 2500550
October 3500500
Refreshing October 2 changes 500 to 550 and leaves October 3 unchanged

Run the Steps in OrderOrchestration manages dependencies between pipeline steps

Copy salesfour source rowsBuild daily totalstwo datesCheck and publish500 and 500
The totals depend on copied sales; the report depends on checked totals

Takeaway: Data Warehousing

1An analytical copy gives repeated reports a clear input
2The meaning of one row determines how facts can be joined and summed
3Replace the affected date and check the result so reruns do not double sales
← → / Space · S notes · O overview · F fullscreen · number + Enter
Speaker notes