From 7f9c2261759f87ada5813ecb5548cad44f80b88c Mon Sep 17 00:00:00 2001 From: Nityananda Gohain Date: Fri, 26 May 2023 11:32:39 +0530 Subject: [PATCH] feat: formatter updated (#2780) * feat: formatter updated * feat: formatter updated with all int types --- pkg/query-service/utils/format.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/query-service/utils/format.go b/pkg/query-service/utils/format.go index 7571e900d4..55dbfdc5ab 100644 --- a/pkg/query-service/utils/format.go +++ b/pkg/query-service/utils/format.go @@ -144,7 +144,7 @@ func ValidateAndCastValue(v interface{}, dataType v3.AttributeKeyDataType) (inte // ClickHouseFormattedValue formats the value to be used in clickhouse query func ClickHouseFormattedValue(v interface{}) string { switch x := v.(type) { - case int: + case int, int8, int16, int32, int64: return fmt.Sprintf("%d", x) case float32, float64: return fmt.Sprintf("%f", x) @@ -167,7 +167,7 @@ func ClickHouseFormattedValue(v interface{}) string { } str += "]" return str - case int, float32, float64, bool: + case int, int8, int16, int32, int64, float32, float64, bool: return strings.Join(strings.Fields(fmt.Sprint(x)), ",") default: zap.S().Error("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x[0])))