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) when node holds no aggregate.
The suffix may hold maps, constant-sided binaries, subquery windows, one histogram function and a
ranking (topk/bottomk). A label rewrite below a histogram function can split one histogram
into two, so it is refused alongside a partitioned histogram when it touches the routing key; a
rewrite above the function renames the answer it already folded and is admitted. A ranking reads
the cut’s answer as a whole - topk(k, A ∪ B) is topk(k, topk(k, A) ∪ topk(k, B)) - so ranking
the merged groups once is the query’s ranking. Anything answered above the cut (a histogram
parameter, a ranking’s k) must read no series.