Files
discord9 4d49a96b04 feat(promql): bind one input per selector and lower vector binary operations
The native compiler bound every selector to the same `SeriesSchema` and refused an
operation between two vectors, because an `Input` carried its ordering and what it
produced but not which selector it read: `a + b` and `a + a` compiled to the same
tree.

Each selector is now bound on its own. `compile_selectors` asks a caller-supplied
callback for the layout one selector will be fed in, and reports for every input the
position the executor names it by, the selector's requirement (metric, matchers,
offset, anchor), the layout and the ordering, so a caller above can prepare one scan
per selector and address it. `compile` keeps its signature and is that call with one
layout for every selector.

With each input named, a vector-vector operation lowers to a `Binary` node carrying
the matching the query wrote: `on`/`ignoring`, `group_left`/`group_right`, `fill`.
The output is `binary_output_schema`'s, the same shape the tree's validator demands.

The paths are not re-derived here: one `metrics::walk` over the finished tree names
every input, so the compiler cannot disagree with the executor about a position.

Acceptance is an integration test driving the real compiler into the real executor:
`a + b` over two independent inputs, `a / on(job) b` beside the default matching that
pairs nothing, `group_left` reusing one right series across two left ones, and both
fill directions, including the `group_right` case where `fill_right` supplies the
stand-in for a missing left-hand sample.

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-21 23:55:54 +08:00
..