From 5e0e9da6c4748080a838f3e4fca9ced152bf569f Mon Sep 17 00:00:00 2001 From: Nityananda Gohain Date: Mon, 1 Apr 2024 14:51:40 +0530 Subject: [PATCH] fix: hotfix bug in enhance query (#4783) --- pkg/query-service/app/logs/v3/enrich_query.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/query-service/app/logs/v3/enrich_query.go b/pkg/query-service/app/logs/v3/enrich_query.go index 904b348999..06445d164d 100644 --- a/pkg/query-service/app/logs/v3/enrich_query.go +++ b/pkg/query-service/app/logs/v3/enrich_query.go @@ -153,9 +153,12 @@ func enrichFieldWithMetadata(field v3.AttributeKey, fields map[string]v3.Attribu return field } - // enrich with default values if metadata is not found - field.Type = v3.AttributeKeyTypeTag - field.DataType = v3.AttributeKeyDataTypeString + if field.Type == "" { + field.Type = v3.AttributeKeyTypeTag + } + if field.DataType == "" { + field.DataType = v3.AttributeKeyDataTypeString + } return field }