Skip to content

Commit

Permalink
chore(chstorage): simplify label queries
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Dec 4, 2024
1 parent 43edb59 commit 698c8c6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions internal/chstorage/querier_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ func (q *Querier) LabelNames(ctx context.Context, opts logstorage.LabelsOptions)
Query: chsql.Select(table,
chsql.ResultColumn{
Name: "name",
Expr: chsql.ArrayJoin(
chsql.ArrayConcat(
attrKeys(colResource),
),
),
Expr: chsql.ArrayJoin(attrKeys(colResource)),
Data: &name,
},
).
Expand Down Expand Up @@ -170,9 +166,7 @@ func (q *Querier) LabelValues(ctx context.Context, labelName string, opts logsto
value proto.ColStr
query = chsql.Select(table, chsql.ResultColumn{
Name: "value",
Expr: chsql.ArrayJoin(chsql.Array(
attrSelector(colResource, labelName),
)),
Expr: attrSelector(colResource, labelName),
Data: &value,
}).
Distinct(true).
Expand Down

0 comments on commit 698c8c6

Please sign in to comment.