1. A data engineering team is implementing a Change Data Capture pipeline. They create a standard Stream on a source table and use a Task to consume it every 10 minutes. The task runs the following pattern: ```sql INSERT INTO target_table SELECT col1, col2, METADATA$ACTION FROM my_stream WHERE METADATA$ACTION = 'INSERT'; ``` The team later realizes that UPDATE operations on the source table are not being correctly reflected in the target. Which TWO statements explain this behavior? (Select TWO)
- A. Standard streams represent UPDATEs as a pair of rows: one DELETE row (METADATA$ACTION='DELETE', METADATA$ISUPDATE=TRUE) and one INSERT row (METADATA$ACTION='INSERT', METADATA$ISUPDATE=TRUE); the current WHERE clause discards the DELETE half but keeps the INSERT half✓ Correct
- B. Standard streams do not capture UPDATE operations at all; only INSERT and DELETE actions are tracked
- C. The task must use a MERGE statement instead of INSERT to correctly apply CDC changes including updates to the target table✓ Correct
- D. The WHERE clause filtering on METADATA$ACTION = 'INSERT' will miss the update's new-value row because updates are recorded only as METADATA$ACTION = 'UPDATE'
- E. The METADATA$ISUPDATE flag must be set to FALSE in the WHERE clause to correctly filter for true inserts versus update-inserts
Explanation
Option A is correct: in a standard stream, UPDATEs are represented as two rows — a DELETE row for the old value and an INSERT row for the new value, both with METADATA$ISUPDATE=TRUE. The current query keeps the INSERT half (new value) but discards the DELETE half, so the target will accumulate duplicate rows instead of updating them. Option C is correct: to properly apply CDC (handle inserts, update-new-values, and deletes), a MERGE statement matching on a primary key is required rather than a plain INSERT. Option B is false: standard streams DO capture updates, just as DELETE+INSERT pairs. Option D is false: there is no METADATA$ACTION = 'UPDATE' value; updates appear as DELETE and INSERT pairs. Option E is incorrect: filtering METADATA$ISUPDATE=FALSE would isolate true inserts from update-inserts, but the problem description is about updates not being reflected — this filter would make things worse, not better.