From b92c6c57e5da49b007c0b731b123d096138a6ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Mon, 2 Dec 2024 21:29:30 +0000 Subject: [PATCH] print debug --- flow/model/qvalue/avro_converter.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/flow/model/qvalue/avro_converter.go b/flow/model/qvalue/avro_converter.go index b75bcdc21..2da4eb9ca 100644 --- a/flow/model/qvalue/avro_converter.go +++ b/flow/model/qvalue/avro_converter.go @@ -481,17 +481,18 @@ func (c *QValueAvroConverter) processNullableUnion( } func (c *QValueAvroConverter) processNumeric(num decimal.Decimal) any { - num, err := TruncateOrLogNumeric(num, c.Precision, c.Scale, c.TargetDWH) - if err != nil { - return nil - } - + slog.Warn("chchch", slog.String("name", c.Name), slog.Any("c", c), slog.Any("p", c.Precision), slog.Any("s", c.Scale)) if (c.UnboundedNumericAsString && c.Precision == 0 && c.Scale == 0) || (c.TargetDWH == protos.DBType_CLICKHOUSE && c.Precision > datatypes.PeerDBClickHouseMaxPrecision) { numStr, _ := c.processNullableUnion("string", num.String()) return numStr } + num, err := TruncateOrLogNumeric(num, c.Precision, c.Scale, c.TargetDWH) + if err != nil { + return nil + } + rat := num.Rat() if c.Nullable { return goavro.Union("bytes.decimal", rat)