mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-30 22:54:12 +00:00
23 lines
14 KiB
HTML
23 lines
14 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Segmenting a native tree, so each per-series prefix runs where its input is read."><title>promql::native::segment - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-1ed95124.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="promql" data-themes="" data-resource-suffix="" data-rustdoc-version="1.98.1 (48a229cea 2026-09-01)" data-channel="1.98.1" data-search-js="search-9944d736.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-417ebf0a.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module segment</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../promql/index.html">promql</a><span class="version">1.4.0-alpha.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module segment</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#functions" title="Functions">Functions</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In promql::<wbr>native</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">promql</a>::<wbr><a href="../index.html">native</a></div><h1>Module <span>segment</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/promql/native/segment.rs.html#15-1123">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Segmenting a native tree, so each per-series prefix runs where its input is read.</p>
|
||
<p>A tree that reads across series runs in one partition. Its per-series prefixes are cut out as
|
||
<a href="../../extension_plan/struct.FusedSeries.html" title="struct promql::extension_plan::FusedSeries"><code>FusedSeries</code></a> nodes of their own so they keep their scan partitions: <code>cut_as_segment</code> decides
|
||
what is cut, <a href="fn.cut_segments.html" title="fn promql::native::segment::cut_segments"><code>cut_segments</code></a> rewrites the tree into one segment per cut, and <a href="fn.segment_tree.html" title="fn promql::native::segment::segment_tree"><code>segment_tree</code></a>
|
||
builds the nodes.</p>
|
||
<p>Output columns are the planner’s answer, read through <a href="type.OutputTags.html" title="type promql::native::segment::OutputTags"><code>OutputTags</code></a>, <a href="type.FieldNames.html" title="type promql::native::segment::FieldNames"><code>FieldNames</code></a> and
|
||
<a href="type.RootSchema.html" title="type promql::native::segment::RootSchema"><code>RootSchema</code></a>.</p>
|
||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Segment.html" title="struct promql::native::segment::Segment">Segment</a></dt><dd>One segment: its tree rewritten to its own index space, the scans it reads, and the subtrees cut
|
||
out of it.</dd></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.NATIVE_ORDERING.html" title="constant promql::native::segment::NATIVE_ORDERING">NATIVE_<wbr>ORDERING</a></dt><dd>The ordering trees are compiled against: the weaker of a native scan’s <code>KeyThenTime</code> and a
|
||
two-phase scan’s <code>Contiguous</code>, since the logical planner cannot tell which a statement gets.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.build_evaluated_segment.html" title="fn promql::native::segment::build_evaluated_segment">build_<wbr>evaluated_<wbr>segment</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="fn" href="fn.build_inner_segment.html" title="fn promql::native::segment::build_inner_segment">build_<wbr>inner_<wbr>segment</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Builds one segment’s plan from a subtree without cutting again, and returns it with its output
|
||
tags. <code>None</code> when any part cannot be built.</dd><dt><a class="fn" href="fn.canonical_boundary_stages.html" title="fn promql::native::segment::canonical_boundary_stages">canonical_<wbr>boundary_<wbr>stages</a></dt><dd>Lowers a tree whose root is a canonical merge into a producer and a canonical router, and
|
||
returns the plan with the tags its frames carry.</dd><dt><a class="fn" href="fn.canonical_local_prefix.html" title="fn promql::native::segment::canonical_local_prefix">canonical_<wbr>local_<wbr>prefix</a></dt><dd>Whether the merge producer’s entire prefix can run on each scan partition independently.</dd><dt><a class="fn" href="fn.collect_segment.html" title="fn promql::native::segment::collect_segment">collect_<wbr>segment</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Collects a segment’s scans and cut subtrees, without descending into a cut.</dd><dt><a class="fn" href="fn.collect_segment_inputs.html" title="fn promql::native::segment::collect_segment_inputs">collect_<wbr>segment_<wbr>inputs</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Collects every scan input in a selected segment without looking for nested cuts.</dd><dt><a class="fn" href="fn.contains_canonical_merge.html" title="fn promql::native::segment::contains_canonical_merge">contains_<wbr>canonical_<wbr>merge</a></dt><dt><a class="fn" href="fn.contains_global_consumer.html" title="fn promql::native::segment::contains_global_consumer">contains_<wbr>global_<wbr>consumer</a></dt><dt><a class="fn" href="fn.cut_as_segment.html" title="fn promql::native::segment::cut_as_segment">cut_<wbr>as_<wbr>segment</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Whether <code>node</code> becomes a segment of its own under a parent that must gather.</dd><dt><a class="fn" href="fn.cut_segments.html" title="fn promql::native::segment::cut_segments">cut_<wbr>segments</a></dt><dd>Splits <code>node</code> into one segment and the subtrees cut out of it.</dd><dt><a class="fn" href="fn.evaluated_input_window.html" title="fn promql::native::segment::evaluated_input_window">evaluated_<wbr>input_<wbr>window</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Whether <code>node</code> is a window over an evaluated input (a subquery).</dd><dt><a class="fn" href="fn.exportable.html" title="fn promql::native::segment::exportable">exportable</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Whether <code>node</code> answers an evaluated vector, the only thing a segment boundary carries.</dd><dt><a class="fn" href="fn.find_input_node.html" title="fn promql::native::segment::find_input_node">find_<wbr>input_<wbr>node</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="fn" href="fn.fused_output_schema.html" title="fn promql::native::segment::fused_output_schema">fused_<wbr>output_<wbr>schema</a></dt><dd>The output schema of a fused node: a non-nullable millisecond time index, one nullable column
|
||
of <code>field_kind</code> per field, then nullable <code>Utf8</code> tags. Value columns are named by the caller’s
|
||
<a href="type.FieldNames.html" title="type promql::native::segment::FieldNames"><code>FieldNames</code></a>.</dd><dt><a class="fn" href="fn.fused_publish_grid.html" title="fn promql::native::segment::fused_publish_grid">fused_<wbr>publish_<wbr>grid</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>The grid a <code>FusedSeries</code> publishes on: its root’s grid, which inside a subquery is the
|
||
subquery’s grid, or <code>statement_grid</code> for a root without one.</dd><dt><a class="fn" href="fn.independent_scan_pair.html" title="fn promql::native::segment::independent_scan_pair">independent_<wbr>scan_<wbr>pair</a></dt><dt><a class="fn" href="fn.is_canonical_cut.html" title="fn promql::native::segment::is_canonical_cut">is_<wbr>canonical_<wbr>cut</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Whether a subtree can be cut without inheriting its parent’s global gather: a local prefix, or
|
||
a canonical merge that becomes its own routed boundary.</dd><dt><a class="fn" href="fn.is_empty_discovered_input.html" title="fn promql::native::segment::is_empty_discovered_input">is_<wbr>empty_<wbr>discovered_<wbr>input</a></dt><dd>Whether <code>plan</code> is the typed empty input of a discovered selector that matched no table: an
|
||
<code>EmptyRelation</code> declaring the raw explicit-label frame.</dd><dt><a class="fn" href="fn.is_global_consumer.html" title="fn promql::native::segment::is_global_consumer">is_<wbr>global_<wbr>consumer</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Whole-vector consumers stay global, but are cut out as evaluated segments so a pointwise parent
|
||
does not inherit their single-partition placement.</dd><dt><a class="fn" href="fn.is_raw_series_source.html" title="fn promql::native::segment::is_raw_series_source">is_<wbr>raw_<wbr>series_<wbr>source</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="fn" href="fn.is_sourced_plan.html" title="fn promql::native::segment::is_sourced_plan">is_<wbr>sourced_<wbr>plan</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Whether <code>plan</code> is a discovered selector’s <a href="../../extension_plan/struct.RawSeriesSource.html" title="struct promql::extension_plan::RawSeriesSource"><code>RawSeriesSource</code></a>, or the <code>Union</code> of several. It is
|
||
used as is: wrapping it in another source is refused by the physical planner.</dd><dt><a class="fn" href="fn.pointwise_operand.html" title="fn promql::native::segment::pointwise_operand">pointwise_<wbr>operand</a></dt><dd>Whether <code>node</code> evaluates each series on its own, directly over a scan, so one partitioned
|
||
execution is one answer.</dd><dt><a class="fn" href="fn.region_local_segment.html" title="fn promql::native::segment::region_local_segment">region_<wbr>local_<wbr>segment</a></dt><dd>Whether the dist analyzer places a segment over <code>node</code> below the <code>MergeScan</code>.</dd><dt><a class="fn" href="fn.rewrite_inner_segment.html" title="fn promql::native::segment::rewrite_inner_segment">rewrite_<wbr>inner_<wbr>segment</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Rewrites every input leaf in a selected segment to its index in the segment’s own space.</dd><dt><a class="fn" href="fn.rewrite_segment.html" title="fn promql::native::segment::rewrite_segment">rewrite_<wbr>segment</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Rewrites a segment’s tree so every leaf names its index in the segment’s own space.</dd><dt><a class="fn" href="fn.scan_operand.html" title="fn promql::native::segment::scan_operand">scan_<wbr>operand</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="fn" href="fn.segment_tree.html" title="fn promql::native::segment::segment_tree">segment_<wbr>tree</a></dt><dd>Plans <code>tree</code> as several segments, or <code>None</code> when there is nothing to cut or a segment cannot be
|
||
built; the caller then keeps the unsegmented plan.</dd><dt><a class="fn" href="fn.with_row_name_column.html" title="fn promql::native::segment::with_row_name_column">with_<wbr>row_<wbr>name_<wbr>column</a></dt><dd>Moves or appends <code>__name__</code> to the end of a rows layout’s tag list. A scalar root gets no name
|
||
column.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.FieldNames.html" title="type promql::native::segment::FieldNames">Field<wbr>Names</a></dt><dd>The planner’s value column names for the compiled <code>fields</code> of a statement’s expression.</dd><dt><a class="type" href="type.OutputTags.html" title="type promql::native::segment::OutputTags">Output<wbr>Tags</a></dt><dd>The planner’s output tag columns for a node, given each source’s tag columns.</dd><dt><a class="type" href="type.RootSchema.html" title="type promql::native::segment::RootSchema">Root<wbr>Schema</a></dt><dd>The planner’s row schema for a statement root over <code>promql</code>, or <code>None</code> when its columns cannot
|
||
be named once.</dd></dl></section></div></main></body></html> |