pub fn merge_same_labelset(
schema: &Arc<SeriesSchema>,
series: Vec<Series>,
) -> Result<Vec<Series>>Expand description
Merges series that share a label set into one, as Prometheus does after a function that
rewrites labels or drops __name__; two of them holding one field at one point fail, whether
the samples are floats or native histograms.
The merge rearranges the payloads instead of rewriting them: a merged row takes the value its
member carries at that position – a float, a NaN, or a native histogram – and a field another
field’s row does not fill keeps a null there. The values keep their storage: a run of rows one
member holds in one dense segment is handed out as a [Samples::slice] of that segment, so a
histogram table is shared rather than copied. The result costs one row per position holding a
value, plus the rows the other fields fill, and nothing for a position of the grid holding none.