From 8980dff01b3bff46659aeb209a9b81c2a67a80ec Mon Sep 17 00:00:00 2001 From: Brennan Vincent Date: Tue, 19 Nov 2024 18:09:55 -0500 Subject: [PATCH] Don't filter out the "allowed" group by columns --- pkg/query/columnquery.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/query/columnquery.go b/pkg/query/columnquery.go index 18855925d00..2a1d5e82060 100644 --- a/pkg/query/columnquery.go +++ b/pkg/query/columnquery.go @@ -248,9 +248,11 @@ func (q *ColumnQueryAPI) Query(ctx context.Context, req *pb.QueryRequest) (*pb.Q groupByLabels = append(groupByLabels, f) continue } - if _, allowed := allowedGroupBy[f]; !allowed { - return nil, status.Errorf(codes.InvalidArgument, "invalid group by field: %s", f) + if _, allowed := allowedGroupBy[f]; allowed { + groupByLabels = append(groupByLabels, f) + continue } + return nil, status.Errorf(codes.InvalidArgument, "invalid group by field: %s", f) } switch req.Mode {