Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danafallon committed Jul 16, 2024
1 parent b4bc348 commit 31f6442
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/cdc/util/relational_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,10 @@ func (s *SchemaEventPayload) GetData(pkMap map[string]any, tc *kafkalib.TopicCon
if err != nil {
return nil, err
}
retMap[constants.OnlySetDeletedColumnMarker] = false
} else {
retMap = make(map[string]any)
retMap[constants.OnlySetDeletedColumnMarker] = true
}
retMap[constants.OnlySetDeletedColumnMarker] = true
// This is a delete payload, 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 @@ -109,6 +108,7 @@ func (s *SchemaEventPayload) GetData(pkMap map[string]any, tc *kafkalib.TopicCon
return nil, err
}
retMap[constants.DeleteColumnMarker] = false
retMap[constants.OnlySetDeletedColumnMarker] = false
}

if tc.IncludeArtieUpdatedAt {
Expand Down
2 changes: 1 addition & 1 deletion lib/typing/columns/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// shouldSkipColumn takes the `colName` and `softDelete` and will return whether we should skip this column when calculating the diff.
func shouldSkipColumn(colName string, softDelete bool, includeArtieUpdatedAt bool, includeDatabaseUpdatedAt bool, mode config.Mode) bool {
// TODO: Figure out a better way to not pass in so many variables when calculating shouldSkipColumn
if (colName == constants.DeleteColumnMarker || colName == constants.OnlySetDeletedColumnMarker) && softDelete {
if colName == constants.DeleteColumnMarker && softDelete {
// We need this column to be created if soft deletion is turned on.
return false
}
Expand Down

0 comments on commit 31f6442

Please sign in to comment.