Skip to main content
πŸ“˜ Complete PDF

Snowflake Certification Practice Test 09

Practice Test 09

Question 1 of 20
βš–οΈ Statement Analysis
Question 141
Statement 1: A Snowflake Stream creates an offset cursor to record row-level DML mutations (inserts, updates, deletes) made to a source table. Statement 2: A Snowflake Stream automatically executes downstream ETL and data transformation logic without requiring a Task or SQL transaction.
βœ“
A. Only Statement 1 is correct
B. Only Statement 2 is correct
C. Both Statements are correct
D. Neither Statement is correct
Answer
βœ… A. Only Statement 1 is correct
Explanation

1. Direct Question Answer & Core Concept βœ… A. Only Statement 1 is correct

Core Concept: A Snowflake Stream captures CDC change tracking metadata on a source table; it does not execute transformations on its own, requiring an external Task or consumer transaction to process the data.

2. Deep-Dive Analytical Explanation Statement 1 is TRUE: A Stream acts as an offset cursor pointing to change vectors in the source table's transaction history, exposing changed rows along with metadata columns (`METADATA$ACTION`, `METADATA$ISUPDATE`, `METADATA$ROW_ID`). Statement 2 is FALSE: A Stream is purely a passive change-tracking object. It does not execute transformations or move data. A Task, stored procedure, or application must execute a DML statement (`MERGE`, `INSERT`) consuming the stream to process the changes and advance the offset.

3. Comprehensive Option Analysis & Distractor Dissection - **B. Only Statement 2 is correct:** Incorrect because Statement 2 falsely claims streams automatically execute ETL logic. - **C. Both Statements are correct:** Incorrect because Statement 2 is false. - **D. Neither Statement is correct:** Incorrect because Statement 1 accurately defines the technical role of Snowflake Streams.

4. Architectural & Execution Context / Physical Execution Streams utilize the metadata layer and micro-partition history without duplicating storage. When a downstream consumer commits a DML statement reading from the stream, Snowflake transactionally advances the stream offset.

5. Practical Code Example

-- Consuming a stream via an automated task
CREATE OR REPLACE STREAM orders_stream ON TABLE raw.orders;

-- The task executes the processing logic that the stream cannot perform alone
CREATE OR REPLACE TASK process_orders_task
  WAREHOUSE = compute_wh
  SCHEDULE = '5 MINUTE'
  WHEN SYSTEM$STREAM_HAS_DATA('orders_stream')
AS
  INSERT INTO analytics.orders_summary
  SELECT order_id, customer_id, total_price 
  FROM orders_stream 
  WHERE METADATA$ACTION = 'INSERT';

6. Key Takeaway Streams capture row-level changes; downstream Tasks or SQL statements must be used to execute the actual transformation logic.

7. Best Practice & Production Recommendation Always pair Streams with Tasks using the condition `WHEN SYSTEM$STREAM_HAS_DATA('stream_name')` to avoid unnecessary warehouse resume costs.

8. Real-World Engineering Scenario A junior engineer created a Stream and wondered why target reporting tables weren't updating. The team explained that Streams merely expose change records, and configured an automated Task to consume the stream into the analytics layer.

9. Common Exam Trap / Anti-Pattern / Misconception Running `SELECT * FROM stream` does not consume the stream or advance its offset. Only a DML statement (`INSERT`, `UPDATE`, `DELETE`, `MERGE`) advances the stream cursor.

10. Related InsightfulSaga Tutorial Master these concepts in [Snowflake Core Architecture & Operations](/tutorials/snowflake/snowflake-streams).

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