0

I want to reflect insert and update of a table:

CREATE OR REFRESH STREAMING LIVE TABLE dlt_stage2_bronze_streaming_students ;
APPLY CHANGES INTO LIVE.dlt_stage2_bronze_streaming_students
FROM stream(dlt_test.stage2_test_students_raw)
KEYS (id) 
    where id >= 0
    SEQUENCE BY
      audit_insert 
STORED AS SCD TYPE 2;

I can insert rows but if I update rows in "dlt_test.stage2_test_students_raw", the pipeline fails immediately. I know streaming table only supports "append-only" resource but the official doc says:

The default behavior for INSERT and UPDATE events is to upsert CDC events from the source: update any rows in the target table that match the specified key(s) or insert a new row when a matching record does not exist in the target table.

How can I update the source table and get it reflected in target table using CDC?

user3692015
  • 391
  • 4
  • 15

0 Answers0