Skip to main content
πŸ“˜ Complete PDF

Snowflake Certification Practice Test 08

Practice Test 08

Question 1 of 20
πŸ”˜ Multi-Select (Select all that apply)
Question 121
A newly joined Data Engineer at a global retail enterprise reviews a legacy ETL process that reloads 2 billion sales transaction records every midnight, even though only 50,000 records mutate daily. Management demands an immediate reduction in pipeline runtime and Snowflake credit consumption. Which architectural recommendations should the engineer implement?
βœ“
Implement Change Data Capture (CDC) processing using Snowflake Streams
βœ“
Deploy Snowflake Streams on source tables to track inserts, updates, and deletes
βœ“
Filter and process only changed records using delta MERGE statements into target tables
Increase the virtual warehouse size permanently from Large to 4X-Large
βœ“
Transition from full table overwrites to an incremental loading architecture
Reload the entire 2 billion record historical dataset every midnight
Answer
βœ… Implement CDC processing using Snowflake Streams βœ… Deploy Snowflake Streams on source tables to track inserts, updates, and deletes βœ… Filter and process only changed records using delta MERGE statements into target tables βœ… Transition from full table overwrites to an incremental loading architecture
Explanation

1. Direct Question Answer & Core Concept βœ… Implement CDC processing using Snowflake Streams βœ… Deploy Snowflake Streams on source tables to track inserts, updates, and deletes βœ… Filter and process only changed records using delta MERGE statements into target tables βœ… Transition from full table overwrites to an incremental loading architecture

Core Concept: Change Data Capture (CDC) with Snowflake Streams and incremental MERGE operations processes only modified records, drastically slashing compute runtimes and credit consumption compared to brute-force full table reloads.

2. Deep-Dive Analytical Explanation Reloading 2 billion rows nightly to capture 50,000 mutations (0.0025% of the table) is an extreme compute anti-pattern. Snowflake Streams capture row-level changes (DML deltas with `METADATA$ACTION` and `METADATA$ISUPDATE`) without scanning historical partitions. Downstream Tasks execute an incremental `MERGE` statement, updating modified rows and appending new ones in seconds using an X-Small or Small warehouse.

3. Comprehensive Option Analysis & Distractor Dissection - **Increase the virtual warehouse size permanently from Large to 4X-Large:** Brute-force hardware scaling that increases credit burn by 8x without resolving the inefficient full-table reload architecture. - **Reload the entire 2 billion record historical dataset every midnight:** The exact legacy anti-pattern that the engineering team was tasked with replacing.

4. Architectural & Execution Context / Physical Execution Snowflake Streams create an offset cursor pointing to table transaction history. Consuming a stream in an automated Task advances the stream offset transactionally inside the MERGE commit, guaranteeing exactly-once incremental processing.

5. Practical Code Example

-- Creating a stream to capture CDC mutations on orders
CREATE OR REPLACE STREAM orders_cdc_stream ON TABLE raw_pos.orders;

-- Incremental MERGE task consuming only changed records
MERGE INTO analytics.curated_orders target
USING (
  SELECT * FROM orders_cdc_stream
) src
ON target.order_id = src.order_id
WHEN MATCHED AND src.METADATA$ACTION = 'DELETE' THEN DELETE
WHEN MATCHED AND src.METADATA$ACTION = 'INSERT' AND src.METADATA$ISUPDATE = TRUE THEN
  UPDATE SET target.order_status = src.order_status, target.total_amount = src.total_amount
WHEN NOT MATCHED AND src.METADATA$ACTION = 'INSERT' THEN
  INSERT (order_id, customer_id, order_status, total_amount, order_timestamp)
  VALUES (src.order_id, src.customer_id, src.order_status, src.total_amount, src.order_timestamp);

6. Key Takeaway Replace full-table reloads with Snowflake Streams and incremental MERGE logic to achieve order-of-magnitude savings in time and credits.

7. Best Practice & Production Recommendation Always pair Streams with automated Tasks conditioned on `SYSTEM$STREAM_HAS_DATA('stream_name')` so warehouses spin up only when mutations exist.

8. Real-World Engineering Scenario A retail client spent 4 hours nightly running a 3X-Large warehouse ($256/night) reloading their point-of-sale master table. Implementing CDC with Streams reduced processing time to 45 seconds on an X-Small warehouse, saving over $90,000 annually.

9. Common Exam Trap / Anti-Pattern / Misconception Querying a Stream without consuming it inside a DML transaction. A simple `SELECT * FROM stream` does not advance the offset; only a DML statement (`INSERT`, `MERGE`, `CREATE TABLE AS`) advances the stream cursor.

10. Related InsightfulSaga Tutorial Master these concepts in [Snowflake Enterprise Architecture](/tutorials/snowflake/snowflake-incremental-loading-cdc).

Answered: 0 / 20
Question Navigator (Test 08)0% Answered