A data engineer is designing a pipeline using Snowflake Streams and Tasks to process CDC data. Which TWO characteristics correctly describe the behavior of a standard table stream when consumed by a DML statement? (Choose TWO)
Trap 1: The stream is automatically dropped after its content is read by a…
Reading from a stream using a simple SELECT statement does not consume the data or advance the offset. Streams are persistent objects that remain in the schema until explicitly dropped by a user. They are designed to be consumed by DML operations like INSERT, MERGE, or UPDATE to drive incremental data loading workflows.
Trap 2: A stream can only be created on permanent tables, not on transient…
Snowflake supports creating streams on permanent, transient, and even temporary tables to track changes. While the lifecycle of the stream is tied to the existence of the source table, the table type does not strictly limit the stream's creation. This flexibility allows engineers to use streams for intermediate processing steps using transient storage.
Trap 3: The stream will store a physical copy of the source data until it…
Streams do not store actual data records but rather act as a pointer or bookmark to the versioning history of the source table. They leverage Snowflake's Time Travel metadata to present the delta between two points in time. This design is highly efficient as it avoids duplicating storage costs while providing change data.
- A
The stream offset advances only when the DML transaction is successfully committed.
Snowflake ensures transactional integrity by only moving the stream's change tracking pointer forward after the consuming DML statement successfully completes. If the transaction fails or is rolled back, the stream retains its original data. This mechanism allows for reliable retries in automated task schedules without the risk of skipping records.
- B
The stream is automatically dropped after its content is read by a SELECT statement.
Why it fails: Reading from a stream using a simple SELECT statement does not consume the data or advance the offset. Streams are persistent objects that remain in the schema until explicitly dropped by a user. They are designed to be consumed by DML operations like INSERT, MERGE, or UPDATE to drive incremental data loading workflows.
- C
Multiple DML statements can consume the same stream offset if executed in the same transaction.
Snowflake allows multiple DML statements within a single transaction to read from the same stream at the same offset. This is useful for multi-table inserts where the same change data needs to populate different target tables simultaneously. The offset only advances once the entire transaction is finalized, ensuring consistency across all tables.
- D
A stream can only be created on permanent tables, not on transient or temporary tables.
Why it fails: Snowflake supports creating streams on permanent, transient, and even temporary tables to track changes. While the lifecycle of the stream is tied to the existence of the source table, the table type does not strictly limit the stream's creation. This flexibility allows engineers to use streams for intermediate processing steps using transient storage.
- E
The stream will store a physical copy of the source data until it is consumed.
Why it fails: Streams do not store actual data records but rather act as a pointer or bookmark to the versioning history of the source table. They leverage Snowflake's Time Travel metadata to present the delta between two points in time. This design is highly efficient as it avoids duplicating storage costs while providing change data.