diff --git a/flow/model/qvalue/avro_converter.go b/flow/model/qvalue/avro_converter.go index b75bcdc21b..2da4eb9ca2 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)