Skip to content

[Feature] DataFusion engine E3 (S2): eval_time, TimeRange, TimeShift, range functions #1509

Backlog

Description

@milindsrivastava1997

Example

rate(http_requests_total[5m]) as an instant query at T and as a range query (start, end, step=15s), from planner output, matches hand-computed answers including counter resets and edge extrapolation.

User need and MVP

Time handling for many evaluation times from the start. Simplest correct version only; no performance work (design doc, Principle).

Authoritative design

D7, D13 (TimeRange, TimeShift, range functions). Use E0b's finding for the join. The executor's crates/executor/src/operators/range_function.rs may be read, but its behavior is not trusted.

Agent orchestration: orchestration plan.

Inputs, outputs, and invariants

  • Every operator above the first time-dependent one carries eval_time.
  • TimeRange keeps a row for T when T−s−w < t ≤ T−s; instant lookback keeps the latest row per (series, T).
  • Range functions are one custom operator fused with its TimeRange, reading each series' sorted samples once and emitting (eval_time, keys, value).

Before and after behavior

Before: only time-independent operators. After: rate, increase, *_over_time, offset, instant lookback for instant and range queries.

Unit and end-to-end acceptance tests

  • Per function: hand-written samples (including counter reset, sparse windows, boundary samples exactly at T−w) and expected values.
  • Instant equals the range query's matching step.
  • Acceptance tests written first by a separate agent and approved by a person.

Explicit non-goals

Aggregates (E4a), the sliding pane merge, fusing TimeRange with other consumers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpromqlwindow

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions