fix subquery bug

Signed-off-by: Neeraj Gartia <neerajgartia211002@gmail.com>
This commit is contained in:
Neeraj Gartia
2025-03-31 00:41:08 +05:30
parent 74a1d96c72
commit 9084c5247f
2 changed files with 12 additions and 0 deletions

View File

@@ -1582,6 +1582,11 @@ func (ev *evaluator) eval(ctx context.Context, expr parser.Expr) (parser.Value,
if err := contextDone(ctx, "expression evaluation"); err != nil {
ev.error(err)
}
if ev.endTimestamp < ev.startTimestamp {
return Matrix{}, nil
}
numSteps := int((ev.endTimestamp-ev.startTimestamp)/ev.interval) + 1
// Create a new span to help investigate inner evaluation performances.

View File

@@ -150,3 +150,10 @@ eval instant at 10m increase(native_histogram[10m:3m])
# by the sub-query multiple times.
eval instant at 10m increase(native_histogram[10m:15s])
{} {{count:30.769230769230766 sum:30.769230769230766}}
# When range < resolution and the first evaluation time is out of range.
load 5m
foo 3+0x10
eval instant at 12m min_over_time((topk(1, foo))[1m:5m])
#empty