Skip to content

Commit

Permalink
null out invalid timestamp in pull side
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Feb 13, 2024
1 parent aba0653 commit 4f0fd06
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions flow/connectors/postgres/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,14 @@ func (p *PostgresCDCSource) decodeColumnData(data []byte, dataType uint32, forma
parsedData, err = dt.Codec.DecodeValue(p.typeMap, dataType, formatCode, data)
}
if err != nil {
if dt.Name == "time" || dt.Name == "timetz" ||
dt.Name == "timestamp" || dt.Name == "timestamptz" {
p.logger.Info(fmt.Sprintf("Invalidated and hence nulled %s data: %s",
dt.Name, string(data)))
// indicates year is more than 4 digits,
// or a malformed time string in general
return qvalue.QValue{}, nil
}
return qvalue.QValue{}, err
}
retVal, err := parseFieldFromPostgresOID(dataType, parsedData)
Expand Down

0 comments on commit 4f0fd06

Please sign in to comment.