From 99a4bc455a8ef4b6da25b5e95800651124ccc823 Mon Sep 17 00:00:00 2001 From: Egor Riashin Date: Tue, 20 Feb 2024 20:45:04 +0300 Subject: [PATCH] Measure filter validation (#4109) --- runtime/queries/metricsview_aggregation.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/queries/metricsview_aggregation.go b/runtime/queries/metricsview_aggregation.go index 0169b9af873..40bf3fd1766 100644 --- a/runtime/queries/metricsview_aggregation.go +++ b/runtime/queries/metricsview_aggregation.go @@ -417,8 +417,8 @@ func (q *MetricsViewAggregation) buildMetricsAggregationSQL(mv *runtimev1.Metric filterCount++ } } - if filterCount > 1 { - return "", nil, errors.New("multiple measure filters") + if filterCount != 0 && len(q.Measures) > 1 { + return "", nil, errors.New("multiple measures with filter") } if filterCount == 1 && len(q.PivotOn) > 0 { return "", nil, errors.New("measure filter for pivot-on")