diff --git a/execution/aggregate/hashaggregate.go b/execution/aggregate/hashaggregate.go index 088dc3bd..84e7fb41 100644 --- a/execution/aggregate/hashaggregate.go +++ b/execution/aggregate/hashaggregate.go @@ -234,7 +234,7 @@ func (a *aggregate) initializeScalarTables(ctx context.Context) ([]aggregateTabl labelsMap[lblName] = struct{}{} } for i := 0; i < len(series); i++ { - hash, _, lbls := hashMetric(builder, series[i], !a.by, a.labels, labelsMap, hashingBuf) + hash, lbls := hashMetric(builder, series[i], !a.by, a.labels, labelsMap, hashingBuf) output, ok := outputMap[hash] if !ok { output = &model.Series{ diff --git a/execution/aggregate/khashaggregate.go b/execution/aggregate/khashaggregate.go index 62cfe40a..0ea9ba95 100644 --- a/execution/aggregate/khashaggregate.go +++ b/execution/aggregate/khashaggregate.go @@ -184,7 +184,7 @@ func (a *kAggregate) init(ctx context.Context) error { labelsMap[lblName] = struct{}{} } for i := 0; i < len(series); i++ { - hash, _, _ := hashMetric(builder, series[i], !a.by, a.labels, labelsMap, hashingBuf) + hash, _ := hashMetric(builder, series[i], !a.by, a.labels, labelsMap, hashingBuf) h, ok := heapsHash[hash] if !ok { h = &samplesHeap{compare: a.compare} diff --git a/execution/aggregate/scalar_table.go b/execution/aggregate/scalar_table.go index 98c232fb..9173ae78 100644 --- a/execution/aggregate/scalar_table.go +++ b/execution/aggregate/scalar_table.go @@ -109,7 +109,7 @@ func hashMetric( grouping []string, groupingSet map[string]struct{}, buf []byte, -) (uint64, string, labels.Labels) { +) (uint64, labels.Labels) { buf = buf[:0] builder.Reset() @@ -123,12 +123,12 @@ func hashMetric( } builder.Add(lbl.Name, lbl.Value) }) - key, bytes := metric.HashWithoutLabels(buf, grouping...) - return key, string(bytes), builder.Labels() + key, _ := metric.HashWithoutLabels(buf, grouping...) + return key, builder.Labels() } if len(grouping) == 0 { - return 0, "", labels.Labels{} + return 0, labels.Labels{} } metric.Range(func(lbl labels.Label) { @@ -137,8 +137,8 @@ func hashMetric( } builder.Add(lbl.Name, lbl.Value) }) - key, bytes := metric.HashForLabels(buf, grouping...) - return key, string(bytes), builder.Labels() + key, _ := metric.HashForLabels(buf, grouping...) + return key, builder.Labels() } type newAccumulatorFunc func() *accumulator