Clear the start and end times for derivative calls

Derivatives rely on the underlying iterator to handle start and end
times. They do not perform them or organize points into groups. In
certain circumstances, the start time or end time that got implicitly
passed could be on an uneven interval with the first point returned by
the aggregate, which caused the entire iterator not to be read.

This fixes #5571.
pull/5643/head
Jonathan A. Sternberg 2016-02-11 16:17:15 -05:00
parent 846ab5da8a
commit f5d8a4a6c0
1 changed files with 2 additions and 1 deletions

View File

@ -311,8 +311,9 @@ func buildExprIterator(expr Expr, ic IteratorCreator, opt IteratorOptions) (Iter
interval := opt.DerivativeInterval()
isNonNegative := (expr.Name == "non_negative_derivative")
// Derivatives do not use GROUP BY intervals, so clear this option.
// Derivatives do not use GROUP BY intervals or time constraints, so clear these options.
opt.Interval = Interval{}
opt.StartTime, opt.EndTime = MinTime, MaxTime
return newDerivativeIterator(input, opt, interval, isNonNegative), nil
default:
panic(fmt.Sprintf("unsupported call: %s", expr.Name))