Skip to content

Instantly share code, notes, and snippets.

merge into vimeo.video t
using (
select
t.record_content:op::text as op
-- for the 'd' case, the 'id' will only come through in the 'before' section
, coalesce(t.record_content:before.id::integer, t.record_content:after.id::integer) as id
, t.record_content:after.user_id::integer as user_id
, t.record_content:after.video_title::text as video_title
, to_timestamp_tz(t.record_content:after.created_at::integer, 3) as created_at
@oolongtea
oolongtea / video_cdc_event_snowflake
Last active June 29, 2021 17:40
Example Debezium CDC record in Snowflake
// record_metadata
{
"CreateTime": 1595535726000,
"key": "{\"id\":1}",
"offset": 4000,
"partition": 2,
"topic": "debezium.myschema.video"
}
//record_content