pub(crate) fn split(
node: &NativeNode,
fields: &[FieldSpec],
time_index: &str,
) -> Result<Option<Split>>Expand description
Splits the innermost aggregate out of node.
Ok(None) is a subtree holding no aggregate. Point-wise operations can run where their groups
are owned. Histogram functions can also run there when the state router co-locates every bucket
and every histogram whose output labels collide. A label rewrite may change that key, so it is
only admitted alongside a partitioned histogram when it cannot change a label in the cut’s
routing key. A single-owner histogram needs no such restriction. A histogram parameter is
answered above the cut, so it has to read no series: one that does would be silently replaced by
the merged values. topk, a second aggregate and vector-vector matching still need a whole-vector
boundary.
An instant selection or a window over raw samples above the cut cannot be applied to the merged values under the tree’s current binding: the cut output is evaluated, whereas these nodes consume raw samples. A subquery window instead reads an evaluated input, so it is admitted when its declared grid equals its direct input’s grid.