Skip to content

Commit

Permalink
More.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Apr 11, 2024
1 parent c93e1db commit 1ba50dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cdc/mongo/debezium.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (s *SchemaEventPayload) GetColumns() *columns.Columns {

func (s *SchemaEventPayload) GetData(pkMap map[string]any, tc *kafkalib.TopicConfig) map[string]any {
var retMap map[string]any
if len(s.Payload.afterMap) == 0 {
if len(s.Payload.GetAfterMap()) == 0 {
// This is a delete event, so mark it as deleted.
// And we need to reconstruct the data bit since it will be empty.
// We _can_ rely on *before* since even without running replicate identity, it will still copy over
Expand All @@ -169,7 +169,7 @@ func (s *SchemaEventPayload) GetData(pkMap map[string]any, tc *kafkalib.TopicCon
retMap[tc.IdempotentKey] = s.GetExecutionTime().Format(ext.ISO8601)
}
} else {
retMap = s.Payload.afterMap
retMap = s.Payload.GetAfterMap()
// We need this because there's an edge case with Debezium
// Where _id gets rewritten as id in the partition key.
for k, v := range pkMap {
Expand Down

0 comments on commit 1ba50dc

Please sign in to comment.