Repository navigation
Commit 2628423
`max_over_time(rate(m[5m])[1h:])` and the rest of the
`*_over_time`/`quantile_over_time`-of-sub-query family were rejected —
`extract_matrix` only accepts a (parenthesised) matrix selector, not the
`PromQLSubquery` a sub-query argument produces.
`walk_call` now intercepts a `*_over_time` call whose argument is a
sub-query, lowers the sub-query recursively, and reduces it per series:
max_over_time(rate(m[5m])[1h:])
-> Aggregate{Max} -> Subquery{1h} -> Aggregate{Rate} -> TimeRange{5m} -> Scan
Non-sub-query calls fall through to the existing flat template unchanged,
so plain `max_over_time(m[w])` and heavy-hitter
`topk(k, count_over_time(m[w]))` are untouched.
Per-series correctness: an empty-keys aggregate over a `Subquery` is now
recognised as a label-preserving per-series range reduction, mirroring the
existing `TimeRange` marker. This is sound because a genuine cross-series
aggregation operator over a range vector (`sum(rate(m[5m])[1h:])`) is a
PromQL type error the parser already rejects — so an `Aggregate` directly
over a `Subquery` only ever arises from this per-series `*_over_time` shape.
Verified by `sum by (job) (max_over_time(rate(m[5m])[1h:]))`: the inner
`Max` preserves `job` for the outer `sum by (job)` to group on.
Flips the `over_time_of_subquery_is_rejected__GAP` conformance test into
three passing tests (per-series reduction, `quantile_over_time` phi, outer
aggregation label preservation). Full workspace suite green; clippy clean.
Co-authored-by: zz_y <zz_y@node0.zz-y-308294.softmeasure-pg0.clemson.cloudlab.us>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b324676 commit 2628423
3 files changed
Lines changed: 124 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
436 | 443 | | |
437 | 444 | | |
438 | 445 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
193 | 251 | | |
194 | 252 | | |
195 | 253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
656 | 704 | | |
657 | 705 | | |
658 | 706 | | |
| |||
0 commit comments