Skip to content

Commit

Permalink
Numeric nil case: cdc fix (#1225)
Browse files Browse the repository at this point in the history
Checks for nil value of rat in `toMap` which is responsible for
converting records to json for writing to avro files
  • Loading branch information
Amogh-Bharadwaj committed Feb 7, 2024
1 parent a1f0d96 commit 421128e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions flow/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ func (r *RecordItems) toMap(hstoreAsJSON bool) (map[string]interface{}, error) {
if !ok {
return nil, errors.New("expected *big.Rat value")
}

if bigRat == nil {
jsonStruct[col] = nil
continue
}
jsonStruct[col] = bigRat.FloatString(100)
case qvalue.QValueKindFloat64:
floatVal, ok := v.Value.(float64)
Expand Down

0 comments on commit 421128e

Please sign in to comment.