From 4a3e3dabd588b74fdf4d536f4ebddf870655554a Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Tue, 24 Oct 2023 11:00:06 -0400 Subject: [PATCH] fix conditional flow --- flow/connectors/postgres/cdc.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/flow/connectors/postgres/cdc.go b/flow/connectors/postgres/cdc.go index 9b9b07afb3..b90e9d779b 100644 --- a/flow/connectors/postgres/cdc.go +++ b/flow/connectors/postgres/cdc.go @@ -537,21 +537,26 @@ func (p *PostgresCDCSource) decodeColumnData(data []byte, dataType uint32, forma typeName, ok := p.customTypeMapping[dataType] if ok { - var wkt string customQKind := customTypeToQKind(typeName) if customQKind == qvalue.QValueKindGeography || customQKind == qvalue.QValueKindGeometry { - wkt, err = GeoValidate(string(data)) + wkt, err := GeoValidate(string(data)) if err != nil { return &qvalue.QValue{ Kind: customQKind, Value: nil, }, nil + } else { + return &qvalue.QValue{ + Kind: customQKind, + Value: wkt, + }, nil } + } else { + return &qvalue.QValue{ + Kind: customQKind, + Value: string(data), + }, nil } - return &qvalue.QValue{ - Kind: customQKind, - Value: wkt, - }, nil } return &qvalue.QValue{Kind: qvalue.QValueKindString, Value: string(data)}, nil