diff --git a/pkg/query-service/utils/format.go b/pkg/query-service/utils/format.go index 743109e86b..1acf9d6ff8 100644 --- a/pkg/query-service/utils/format.go +++ b/pkg/query-service/utils/format.go @@ -303,7 +303,7 @@ func GetClickhouseColumnName(typeName string, dataType, field string) string { typeName = constants.Attributes } - if typeName != string(v3.AttributeKeyTypeResource) { + if typeName != string(v3.AttributeKeyTypeResource) && len(typeName) > 0 { typeName = typeName[:len(typeName)-1] } @@ -319,7 +319,7 @@ func GetClickhouseColumnNameV2(typeName string, dataType, field string) string { typeName = constants.Attributes } - if typeName != string(v3.AttributeKeyTypeResource) { + if typeName != string(v3.AttributeKeyTypeResource) && len(typeName) > 0 { typeName = typeName[:len(typeName)-1] }