Before you beginLearn to reconcile pipeline stages
Build the dashboard around the delivery promise
Start with one row per expected batch. A LEFT JOIN preserves an expected batch even when it has no audit rows. Combine attempts by batch ID before joining so a repeat does not increase the delivery count. Keep both the latest attempt and first successful publication if you need to distinguish an earlier failure from a later recovery.
The example computes an as-of report for the capstone data. It includes expected rows whose deadline is within the selected look-back or a future planned delivery. In production, filter both ends of the reporting window and use a controlled calendar so a missing expectation is itself detectable.
| Checkpoint | Batch | Attempts | Failures | Delivery state |
|---|---|---|---|---|
| 08:00 UTC | B101 | 1 | 0 | ON_TIME |
| 08:00 UTC | B102 | 1 | 1 | MISSING |
| 08:12 UTC | B102 | 2 | 1 | LATE_RECOVERED |
WITH attempt_rollup AS (
SELECT batch_id,
COUNT(*) AS attempts,
COALESCE(COUNT_IF(status IN ('REJECTED', 'ERROR')), 0) AS failures,
MIN(IFF(status = 'PUBLISHED', finished_at, NULL)) AS first_publish,
MAX(IFF(status = 'PUBLISHED', source_cutoff, NULL)) AS published_source_cutoff
FROM LS_M20_OPS_LAB.OPS.BATCH_AUDIT GROUP BY batch_id
)
SELECT e.batch_id, e.due_at, a.first_publish,
COALESCE(a.attempts, 0) AS attempts, COALESCE(a.failures, 0) AS failures,
DATEDIFF('minute', a.published_source_cutoff, CURRENT_TIMESTAMP()) AS data_age_min,
CASE WHEN a.first_publish <= e.due_at THEN 'ON_TIME'
WHEN a.first_publish > e.due_at THEN 'LATE_RECOVERED'
WHEN e.due_at <= CURRENT_TIMESTAMP() THEN 'MISSING'
ELSE 'WAITING' END AS delivery_state
FROM LS_M20_OPS_LAB.OPS.EXPECTED_BATCHES AS e
LEFT JOIN attempt_rollup AS a ON e.batch_id = a.batch_id
WHERE e.due_at >= DATEADD('day', -7, CURRENT_TIMESTAMP())
ORDER BY e.due_at;Choose measures that lead to an action
Show delivery success rate as on-time deliveries divided by all expected deliveries whose due time passed. Show freshness as the distance from the current clock to the last verified source cutoff. Track execution duration from attempt start to finish, and count failed attempts separately from missed deliveries. In a trend, display a typical duration and a high percentile so slow runs are visible. Use a volume-aware comparison for rates.
Add task failures, sustained queueing, replication lag and publishing status as separate panels. Include timestamp, time zone, source and update frequency for each panel. Show “no evidence” or “monitor stale” when appropriate. In Snowsight or an approved dashboard tool, use a warehouse and a read-only role with approved access to the audit. Aggregate or filter SQL text, identities and object details before sharing the dashboard.
| Measure | Example | Decision |
|---|---|---|
| Report delivery | B102 missing at cutoff | Page the data owner for a time-sensitive report. |
| Run duration | Most runs take 2 min; latest took 15 min | Inspect timing by stage and warehouse queue. |
| Data age | Current report reflects yesterday’s source cutoff | Check expected arrival and last verified publication. |
| Monitor heartbeat | Last check was two intervals ago | Check the monitoring job even if no pipeline alert fired. |
Walk through the missed Maple Market report
At 08:00 UTC the operations dashboard shows yesterday’s sales. Record the report, batch ID, detection time and business impact. The incident owner updates the report owner. Do not skip evidence collection by restarting the pipeline.
Check each likely cause in order. Save query IDs and sanitized metadata, and compare against the same batch. The example below is a simulated clocked incident. In the capstone, a controlled missing amount reproduces the problem using the test account’s actual timestamps.
| Hypothesis | Evidence | Decision |
|---|---|---|
| Source arrival | 07:48 UTC · file and manifest show 2 expected rows | Source delivered. Check what raw received. |
| Load / ingestion | Raw table contains 2 B102 records | The transport was complete in this case. |
| Orchestration | 07:50 UTC · task failed; history gives q-maple-22 | Trace the statement to the validation audit. |
| Compute capacity | No sustained warehouse queue at 07:50 | Focus on the failed validation, not a warehouse change. |
| Data quality | B102 order 704 is missing AMOUNT | Ask the source owner for a correction before retrying. |
| Recovery | 08:12 UTC · both B102 rows published and sum to 100 | Close after checking totals and telling the report owner. |
- Detect missing publicationCollect evidence to Trace first failed handoff
- Trace first failed handoffChoose a fix to Correct and retry
- Correct and retryConfirm result to Verify and prevent
- Detect missing publication
- B102 due at 08:00 UTC.
- Trace first failed handoff
- Source and load checked, validation rejected.
- Correct and retry
- One controlled write using the original batch ID.
- Verify and prevent
- Reconcile target, mark the incident and add prevention.
Close the incident only after validating the impact
Acknowledge the breach, keep the failed attempt and document why it happened. Check the published report with the same role and filters actual users use. Confirm that a retry preserved earlier successful batches and did not send duplicate alerts.
Assign the source owner to validate sales amounts before delivery. Assign the data platform team to add a pre-deadline check and a monitor heartbeat. Record who owns each action and what evidence will prove it is finished.
Interview practice
Explain the decision and the evidence you would use to test it.
Beginner · What does an operational dashboard show?
I show promised outcomes first, including delivery time and freshness. I add the supporting task, warehouse and ingestion status so someone can trace a failure.
SQL · How do you show a batch that never ran?
I left join scheduled batches to a summary of audit attempts. An expected row stays in the output even with zero attempts, so it becomes MISSING after the deadline.
Production · How would you investigate a failed Task?
I use task history to capture its query ID and error, then check the business audit and preceding handoff. If a retry is safe, I reconcile the published data and confirm the downstream report recovered.
Words used in this lesson
- Incident severity
- Priority based on who is affected, how serious the impact is and how soon action is needed.
- Root cause
- The condition that caused the failure, supported by evidence.
- Runbook
- A tested list of decisions, checks and actions for a known operational situation.
- Heartbeat
- An independent sign that a monitor has checked recently.
Try the SQL or command
Read → predict → run in your learning environment → compare. You can also learn by reading without an account.
Use the SQL and expected outputs in the sections above.
New to SQL? Where to run it and how to read it
A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.
- No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
- For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
- Read the entire example, including comments beginning with
--. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor. - Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
- SELECT / FROM
- Choose the values to return / identify their input.
- VALUES / COLUMN1
- VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
- AS / WITH
- AS gives a result a readable name. WITH names a temporary query step within one statement.
- NULL / ::
- NULL means missing or unknown. The :: notation converts a value to a named data type.
- Session
- One connection and its settings. Keep related transaction steps in the same session.
- Database.schema.table
- A full address for stored data. It is separate from the warehouse that processes queries.
Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →
Help with common practice errors
- No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
- Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
- Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
- Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.
Before running this lesson
Maple Market is fictional. Output tables are representative. Live commands require an authorized test account and the roles, compute and edition listed in each lesson.
Check your understanding
Choose an answer, then check your reasoning. This is practice, not a scored test.
Try it yourself
The monitoring dashboard shows no failed batches for two days. A manager says the report has not updated in two days. Name three checks.
Compare your reasoning
Check the dashboard heartbeat, the expected delivery list, and the latest published source cutoff. Missing jobs can produce no failures and still miss both deliveries.
Connect this lesson to the learning path
Official sources and curriculum
Module 20 · See module scope
By Rohit Ray · Independent educational lesson · Explore this visual lab