Skip to content

Commit

Permalink
fix: interpret missing point as zero value in formula evaluation (Sig…
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanthccv authored Mar 11, 2024
1 parent 5a2d729 commit b4d1296
Show file tree
Hide file tree
Showing 2 changed files with 216 additions and 128 deletions.
17 changes: 0 additions & 17 deletions pkg/query-service/app/formula.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,6 @@ func joinAndCalculate(results []*v3.Result, uniqueLabelSet map[string]string, ex
}
}

vars := expression.Vars()
var doesNotHaveAllVars bool
for _, v := range vars {
if _, ok := seriesMap[v]; !ok {
doesNotHaveAllVars = true
break
}
}

// There is no series that matches the label set from all queries
// TODO: Does the lack of a series from one query mean that the result should be nil?
// Or should we interpret the series as having a value of 0 at all timestamps?
// The current behaviour with ClickHouse is to show no data
if doesNotHaveAllVars {
return nil, nil
}

resultSeries := &v3.Series{
Labels: uniqueLabelSet,
}
Expand Down
Loading

0 comments on commit b4d1296

Please sign in to comment.