Skip to content

[Feature] DataFusion engine E4a: PromQL aggregates and per-group top-k #1512

Backlog

Description

@milindsrivastava1997

Example

sum by (job) (rate(m[5m])), quantile(0.9, …), count_values("v", …) and topk(3, …) by (job) over a range query.

User need and MVP

PromQL aggregation. Simplest correct version only; no performance work (design doc, Principle).

Authoritative design

D13 Aggregate and per-group Sort/Limit rows, including the known NaN and summation differences.

Agent orchestration: orchestration plan.

Inputs, outputs, and invariants

  • AggregateExec with DataFusion's functions, grouped by (eval_time, keys): sum, count, avg, min, max, stddev_pop, var_pop, percentile_cont; count_values groups by the value; group is constant 1.
  • top-k: row_number() over (eval_time, keys) then FilterExec rn <= k.

Before and after behavior

Before: aggregates refused. After: the corpus's exact PromQL aggregate plans run.

Unit and end-to-end acceptance tests

  • Per function: hand-written input and expected output, including empty groups and NaN cases listed in D13.

Explicit non-goals

Kahan summation, Prometheus NaN ordering (known differences).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpromql

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions