promql: Fix another ChunkEncoding call

Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
beorn7 2021-11-22 21:05:49 +01:00
parent 5d4db805ac
commit 8e4e8726bb

View file

@ -903,8 +903,10 @@ func (ev *evaluator) recover(ws *storage.Warnings, errp *error) {
case errWithWarnings: case errWithWarnings:
*errp = err.err *errp = err.err
*ws = append(*ws, err.warnings...) *ws = append(*ws, err.warnings...)
case error:
*errp = err
default: default:
*errp = e.(error) *errp = fmt.Errorf("%v", err)
} }
} }
@ -1753,8 +1755,8 @@ func (ev *evaluator) matrixIterSlice(it *storage.BufferedSeriesIterator, mint, m
} }
buf := it.Buffer() buf := it.Buffer()
if it.ChunkEncoding() == chunkenc.EncHistogram { for buf.Next() {
for buf.Next() { if buf.ChunkEncoding() == chunkenc.EncHistogram {
t, h := buf.AtHistogram() t, h := buf.AtHistogram()
if value.IsStaleNaN(h.Sum) { if value.IsStaleNaN(h.Sum) {
continue continue
@ -1767,9 +1769,7 @@ func (ev *evaluator) matrixIterSlice(it *storage.BufferedSeriesIterator, mint, m
ev.currentSamples++ ev.currentSamples++
out = append(out, Point{T: t, H: h}) out = append(out, Point{T: t, H: h})
} }
} } else {
} else {
for buf.Next() {
t, v := buf.At() t, v := buf.At()
if value.IsStaleNaN(v) { if value.IsStaleNaN(v) {
continue continue