You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support multi-measure per-entity aggregate schemas #409
Allow a Reduction::PerEntity aggregate to represent more than one aggregate measure while preserving the label set, timestamp, and a well-defined output schema for every measure.
Today, per-entity range reductions are structurally limited to one measure. This blocks algebraically valid rewrites such as avg_over_time(x) → sum_over_time(x) / count_over_time(x), tracked by #410.
Current schema derivation encodes the limitation:
Reduction::PerEntity => {debug_assert_eq!(measures.len(),1,"a per-entity reduction is single-aggregate");returnOk(per_series_reduction_schema(in_schema,&measures[0]));}
and the per-series path replaces the one conventional sample-value column:
letmut columns = input.columns.clone();
columns[vi] = out;// `out.name` is forced to "value"
The resulting schema cannot carry both a per-series sum and count. Define and implement the smallest compatible multi-measure schema contract, including naming and type behavior, so downstream lowering and binary operations can safely consume it.
Acceptance criteria
A PerEntity aggregate with multiple measures has a deterministic, validated output schema that preserves timestamp and labels and exposes every measure.
The single-measure PromQL range-function schema remains unchanged: its output sample column is named value and is Float64.
Schema derivation, resolution, and physical lowering either support the new shape end-to-end or reject unsupported forms with a clear error; they must not silently drop measures.
Focused tests cover a two-measure per-entity aggregate and protect existing single-measure range-function behavior.
Activity