Skip to main content

scalar_matching

Function scalar_matching 

Source
fn scalar_matching(op: BinaryOp, return_bool: bool) -> BinaryMatching
Expand description

The matching a vector-and-constant operation records.

Nothing is matched: a scalar carries no labels, so [NativeTree::validate] broadcasts it and reads neither labels nor cardinality. They carry the default a vector–vector operation of the same operator would have, which is also the only matching PromQL allows here — it rejects on, ignoring, group_left and group_right on a scalar–vector operation. return_bool is the one modifier that changes what this operation computes: x > 0 filters the vector and x > bool 0 reports zero or one for each of its values.