mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-12 15:51:30 +08:00
feat: bug-fix in ClickHouseFormattedValue to allow strings
This commit is contained in:
parent
aabf364cc6
commit
faa6fdfcde
@ -190,6 +190,19 @@ func ClickHouseFormattedValue(v interface{}) string {
|
|||||||
zap.L().Error("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x[0])))
|
zap.L().Error("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x[0])))
|
||||||
return "[]"
|
return "[]"
|
||||||
}
|
}
|
||||||
|
case []string:
|
||||||
|
if len(x) == 0 {
|
||||||
|
return "[]"
|
||||||
|
}
|
||||||
|
str := "["
|
||||||
|
for idx, sVal := range x {
|
||||||
|
str += fmt.Sprintf("'%s'", QuoteEscapedString(sVal))
|
||||||
|
if idx != len(x)-1 {
|
||||||
|
str += ","
|
||||||
|
}
|
||||||
|
}
|
||||||
|
str += "]"
|
||||||
|
return str
|
||||||
default:
|
default:
|
||||||
zap.L().Error("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x)))
|
zap.L().Error("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x)))
|
||||||
return ""
|
return ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user