From 421128ea49b54f889ceb9a60231a5a78a09a339f Mon Sep 17 00:00:00 2001 From: Amogh Bharadwaj Date: Thu, 8 Feb 2024 02:45:44 +0530 Subject: [PATCH] Numeric nil case: cdc fix (#1225) Checks for nil value of rat in `toMap` which is responsible for converting records to json for writing to avro files --- flow/model/model.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flow/model/model.go b/flow/model/model.go index 273cf7506c..3213a72434 100644 --- a/flow/model/model.go +++ b/flow/model/model.go @@ -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)