Skip to main content

canonical

Function canonical 

Source
fn canonical(
    node: NativeNode,
    source_tags: &[Vec<String>],
    source_metrics: &[Option<Arc<str>>],
) -> NativeNode
Expand description

Wraps node in a NativeExpr::Merge when its pieces can share a label set.

Three things have to hold, and each is asked rather than assumed:

  • the node’s output is an evaluated vector, because a merge binds samples on a grid and a raw scan, a scalar and aggregate state have nothing it could take;
  • the node can hand over two series of one label set (duplicates_canonical_labels), because collecting pieces that are already distinct is a barrier that buys nothing;
  • it is not already a merge, which would collect what is already collected.