Skip to content

Commit

Permalink
fixing minor review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
heavycrystal committed Nov 27, 2023
1 parent af46026 commit 0d24790
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions flow/connectors/postgres/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,12 @@ func (p *PostgresCDCSource) consumeStream(
TableName: tableName,
PkeyColVal: compositePKeyString,
}
_, ok := tablePKeyLastSeen[tablePkeyVal]
recIndex, ok := tablePKeyLastSeen[tablePkeyVal]
if !ok {
addRecord(rec)
tablePKeyLastSeen[tablePkeyVal] = len(localRecords) - 1
} else {
oldRec := localRecords[tablePKeyLastSeen[tablePkeyVal]]
oldRec := localRecords[recIndex]
// iterate through unchanged toast cols and set them in new record
updatedCols := r.NewItems.UpdateIfNotExists(oldRec.GetItems())
for _, col := range updatedCols {
Expand Down Expand Up @@ -362,9 +362,9 @@ func (p *PostgresCDCSource) consumeStream(
TableName: tableName,
PkeyColVal: compositePKeyString,
}
_, ok := tablePKeyLastSeen[tablePkeyVal]
recIndex, ok := tablePKeyLastSeen[tablePkeyVal]
if ok {
latestRecord := localRecords[tablePKeyLastSeen[tablePkeyVal]]
latestRecord := localRecords[recIndex]
deleteRecord := rec.(*model.DeleteRecord)
deleteRecord.Items = latestRecord.GetItems()
updateRecord, ok := latestRecord.(*model.UpdateRecord)
Expand Down

0 comments on commit 0d24790

Please sign in to comment.