From 5049f9177d23b6f6a6474114b2009f41e8188a3b Mon Sep 17 00:00:00 2001 From: iguazio-deploy Date: Tue, 18 Jun 2019 18:06:45 +0000 Subject: [PATCH] Updated TSDB to v0.9.4 --- .../v3io/v3io-tsdb/pkg/pquerier/frames.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/frames.go b/vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/frames.go index 2f0d4c4b65f..3af3a5dca25 100644 --- a/vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/frames.go +++ b/vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/frames.go @@ -238,16 +238,21 @@ func (d *dataFrame) addMetricIfNotExist(metricName string, columnSize int, useSe } func (d *dataFrame) addMetricFromTemplate(metricName string, columnSize int, useServerAggregates bool) error { - newColumns := make([]Column, len(d.columnsTemplates)) - for i, col := range d.columnsTemplates { + var newColumns []Column + for _, col := range d.columnsTemplates { col.metric = metricName newCol, err := createColumn(col, columnSize, useServerAggregates) if err != nil { return err } - newColumns[i] = newCol - if aggregate.IsCountAggregate(col.function) { + // Make sure there is only 1 count column per metric. + // Count is the only column we automatically add so in some cases we get multiple count columns in the templates. + _, ok := d.metricToCountColumn[metricName] + if !aggregate.IsCountAggregate(col.function) || !ok { + newColumns = append(newColumns, newCol) + } + if aggregate.IsCountAggregate(col.function) && !ok { d.metricToCountColumn[metricName] = newCol } }