Skip to main content

preserves_partition_identity

Function preserves_partition_identity 

Source
fn preserves_partition_identity(
    node: &NativeNode,
    labels: Option<&StoredSeriesLabels>,
) -> bool
Expand description

Whether every series node emits is one series it read, under labels that still tell it apart.

A leaf reads one stored series at a time, and an instant selection of the sample, an instant selection of an info sample and a filtering comparison hand that series over under the labels it read.

labels states what the scan below the tree proves about those labels: the tags each stored series reports, and whether they tell two of them apart once the metadata labels and the empty values are gone. A node that drops the metric name - a range function such as rate, timestamp, a math or histogram map, a parameterized map, and an arithmetic or bool scalar broadcast - drops __type__ and __unit__ with it, and normalizes away every empty label value. The name such a node drops is the one a single-metric scan binds for every series it reads, so dropping it merges nothing; such a node therefore keeps two series apart exactly when the scan keys its series by labels that survive the drop, which is what labels states. Without that proof the name is part of what tells two series apart, and the node can file two of them under one output label set - as it can when the key it drops the empty value of is one column of the two series that holds NULL in one of them and '' in the other.

Everything else answers one series per group or set it names, or pairs several inputs, so an identity above it is not an identity of what it read.