From 60b78e94d84b8e0c837002448b1ca031869ddeaf Mon Sep 17 00:00:00 2001 From: Vishal Sharma Date: Tue, 18 Apr 2023 16:38:52 +0530 Subject: [PATCH] fix: add support for count aggregate attribute (#2584) --- pkg/query-service/app/clickhouseReader/reader.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/query-service/app/clickhouseReader/reader.go b/pkg/query-service/app/clickhouseReader/reader.go index 1b0b771139..0dd0e1e77a 100644 --- a/pkg/query-service/app/clickhouseReader/reader.go +++ b/pkg/query-service/app/clickhouseReader/reader.go @@ -3806,7 +3806,9 @@ func (r *ClickHouseReader) GetLogAggregateAttributes(ctx context.Context, req *v where := "" switch req.Operator { - case v3.AggregateOperatorCountDistinct: + case + v3.AggregateOperatorCountDistinct, + v3.AggregateOpeatorCount: where = "tagKey ILIKE $1" case v3.AggregateOperatorRateSum, @@ -3829,7 +3831,6 @@ func (r *ClickHouseReader) GetLogAggregateAttributes(ctx context.Context, req *v v3.AggregateOperatorMax: where = "tagKey ILIKE $1 AND (tagDataType='int64' or tagDataType='float64')" case - v3.AggregateOpeatorCount, v3.AggregateOperatorNoOp: return &v3.AggregateAttributeResponse{}, nil default: @@ -4228,7 +4229,9 @@ func (r *ClickHouseReader) GetTraceAggregateAttributes(ctx context.Context, req var response v3.AggregateAttributeResponse where := "" switch req.Operator { - case v3.AggregateOperatorCountDistinct: + case + v3.AggregateOperatorCountDistinct, + v3.AggregateOpeatorCount: where = "tagKey ILIKE $1" case v3.AggregateOperatorRateSum, @@ -4251,7 +4254,6 @@ func (r *ClickHouseReader) GetTraceAggregateAttributes(ctx context.Context, req v3.AggregateOperatorMax: where = "tagKey ILIKE $1 AND dataType='float64'" case - v3.AggregateOpeatorCount, v3.AggregateOperatorNoOp: return &v3.AggregateAttributeResponse{}, nil default: