Skip to main content

segment_tree

Function segment_tree 

Source
pub fn segment_tree(
    promql: Arc<str>,
    tree: &NativeTree,
    children: &[LogicalPlan],
    source_tags: &[Vec<String>],
    bare_scans: &[LogicalPlan],
    per_source: &[(Option<Arc<str>>, String, Vec<String>)],
    grid: &Arc<EvalGrid>,
    time_index: &str,
    tags: &[String],
    metric: &Option<Arc<str>>,
    format: FusedOutputFormat,
    canonical_segmentation: bool,
    root_kind: FieldKind,
    remote_raw_boundary: bool,
    output_tags_of: OutputTags,
    field_names: FieldNames,
    root_schema: RootSchema,
) -> Option<LogicalPlan>
Expand description

Plans tree as several segments, or None when it is one node already.

A tree that reads across series answers one partition and gathers whatever it reads. Its per-series prefixes do not need that gather, so each becomes a segment of its own and keeps the partitions it was scanned with. Global consumers and canonical merges are cut in their original order, and recursive segments publish frames for their parents to consume. Only the statement root publishes rows, and it does so under the statement’s own value names: FieldNames answers those, and the rows schema asks RootSchema for the rest of the layout.