Bahador Nooraei is asking about the availability of before
and after
values in a Materialized View row update scenario when using SINKs from RW to Kafka with debezium
format. Martin provides a code snippet showing the structure of the update
event that includes both before
and after
values.
Bahador Nooraei
Asked on Jul 03, 2023
Yes, in the case of an update in a Materialized View row when using SINKs from RW to Kafka with debezium
format, we do get both before
and after
values. The update
event structure includes fields for before
and after
values along with other relevant information. Here is an example of the update
event structure:
Some(json!({
"schema": schema_to_json(schema),
"payload": {
"before": before,
"after": record_to_json(row, &schema.fields, TimestampHandlingMode::Milli)?,
"op": "u",
"ts_ms": ts_ms,
"source": source_field,
}
}))