From 2ca724a172ed965294f16d6d5b3f19d0e2c8e970 Mon Sep 17 00:00:00 2001 From: nityanandagohain Date: Thu, 19 Dec 2024 11:43:42 +0700 Subject: [PATCH] fix: address comments --- pkg/query-service/app/clickhouseReader/reader.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/query-service/app/clickhouseReader/reader.go b/pkg/query-service/app/clickhouseReader/reader.go index 3e281be98f..2a1c1f5782 100644 --- a/pkg/query-service/app/clickhouseReader/reader.go +++ b/pkg/query-service/app/clickhouseReader/reader.go @@ -2948,7 +2948,7 @@ func (r *ClickHouseReader) UpdateLogField(ctx context.Context, field *model.Upda } func (r *ClickHouseReader) GetTraceFields(ctx context.Context) (*model.GetFieldsResponse, *model.ApiError) { - // response will contain top level fields from the otel log model + // response will contain top level fields from the otel trace model response := model.GetFieldsResponse{ Selected: []model.Field{}, Interesting: []model.Field{}, @@ -3091,12 +3091,11 @@ func (r *ClickHouseReader) UpdateTraceField(ctx context.Context, field *model.Up // add a default minmax index for numbers if dataType == "number" { - query = fmt.Sprintf("ALTER TABLE %s.%s ON CLUSTER %s ADD INDEX IF NOT EXISTS `%s_minmax_idx` (`%s`) TYPE minmax GRANULARITY %d", + query = fmt.Sprintf("ALTER TABLE %s.%s ON CLUSTER %s ADD INDEX IF NOT EXISTS `%s_minmax_idx` (`%s`) TYPE minmax GRANULARITY 1", r.TraceDB, r.traceLocalTableName, r.cluster, colname, colname, - field.IndexGranularity, ) err = r.db.Exec(ctx, query) if err != nil {