Study FAQ
How do I verify that a Snowflake stream-and-task pipeline produced the right target data?
Also asked as 2
- Why can a successful Snowflake task still leave an incorrect or stale target?
- What should I reconcile after a Snowflake stream-driven merge or task retry?
Answer
A successful Snowflake task shows that its statement completed. To verify the pipeline, trace the expected source commits through the stream and the task's executed query, then reconcile the target's keys, counts, business totals, freshness, and rejected rows against the expected change set.
Before enabling automatic runs, check stream staleness and inspect CDC metadata for insert, update, and delete cases. Test expected behavior for duplicates, changing or late keys, malformed values, schema changes, and rollback or replay. An upsert with MERGE needs an explicit match key and deterministic inputs. A single target row can match multiple source rows, and unmatched duplicate source rows can produce duplicate inserts. Define which change should win and test that policy before committing a batch.
Check TASK_HISTORY for the run state, error, and query ID. Use the executed query's profile for unexpected warehouse use or latency and check serverless usage where applicable. Compare each run's intended mutations with the actual target rows and audit or rejection record. For a retry, confirm the committed stream offset and which target actions already took effect, then verify that replay converges to the expected state.
Stream consumption semantics · MERGE determinism · Task execution and monitoring · TASK_HISTORY
Full explanation
Snowflake SQL Transformation, Streams, Tasks, and Pipeline Patterns
Study guide · COF-C03
Read the full explanation