Skip to main content

OperatorTree

Enum OperatorTree 

Source
pub enum OperatorTree {
Show 55 variants Empty, Term { query: String, field: Option<String>, scoring: Option<TextScoringMode>, top_k: Option<TextTopKPlan>, }, Filter { field: String, predicate: Predicate, source: Option<Box<OperatorTree>>, }, Facet { field: String, source: Option<Box<OperatorTree>>, }, Score { scorer: ScorerRef, source: Box<OperatorTree>, query_terms: Vec<String>, field: String, }, BayesianScore { source: Box<OperatorTree>, field: Option<String>, }, BayesianMatchWithPrior { field: String, query: String, prior_field: String, mode: ExternalPriorMode, }, Intersect(Vec<OperatorTree>), Union(Vec<OperatorTree>), Complement(Box<OperatorTree>), Composed(Vec<OperatorTree>), EncodeGraphPosting { source: Box<OperatorTree>, }, VectorSimilarity { query_vector: Vec<f32>, threshold: f32, field: String, }, KNN { query_vector: Vec<f32>, k: usize, field: String, }, CalibratedVectorMatch { query_vector: Vec<f32>, k: usize, field: String, threshold: Option<f64>, }, CosineProbability(Box<OperatorTree>), BayesianEvidenceFusion { signals: Vec<OperatorTree>, base_rate: Option<f64>, }, RobustPositiveEvidencePool { signals: Vec<OperatorTree>, alpha: f64, gating: GatingSpec, weights: Option<Vec<f64>>, logit_min: Option<Vec<f64>>, logit_max: Option<Vec<f64>>, adaptive_weights: bool, }, ProbBoolFusion { signals: Vec<OperatorTree>, mode: ProbBoolMode, }, ProbNot { signal: Box<OperatorTree>, default_prob: f64, }, AttentionFusion { signals: Vec<OperatorTree>, attention: AttentionRef, query_features: Vec<f64>, }, LearnedFusion { signals: Vec<OperatorTree>, learned: LearnedFusionRef, }, SparseThreshold { source: Box<OperatorTree>, threshold: f64, }, Traverse { start_vertex: u64, graph: String, label: Option<String>, max_hops: usize, vertex_predicate: Option<VertexPredicate>, }, GraphNeighbors { vertex: u64, graph: String, label: Option<String>, direction: Direction, }, GraphEdges { graph: String, label: Option<String>, }, PatternMatch { pattern: GraphPatternIR, graph: String, }, RegularPathQuery { rpq_source: String, start_vertex: u64, graph: String, }, GraphJoin { left: Box<OperatorTree>, right: Box<OperatorTree>, label: Option<String>, graph: String, }, IndexScan { index_name: String, field: String, predicate: Predicate, }, Aggregate { source: Option<Box<OperatorTree>>, field: String, monoid: Arc<dyn AggregationMonoid>, }, GroupBy { source: Box<OperatorTree>, group_field: String, agg_field: String, monoid: Arc<dyn AggregationMonoid>, }, MultiStage { stages: Vec<MultiStageEntry>, }, MultiFieldSearch { fields: Vec<String>, queries: Vec<String>, weights: Option<Vec<f64>>, }, HybridTextVector { term_op: Box<OperatorTree>, vector_op: Box<OperatorTree>, alpha: f64, }, SemanticFilter { source: Box<OperatorTree>, vector_op: Box<OperatorTree>, }, VectorExclusion { positive: Box<OperatorTree>, negative: Box<OperatorTree>, }, FacetVector { vector_op: Box<OperatorTree>, facet_field: String, }, VertexAggregation { source: Box<OperatorTree>, monoid: Arc<dyn AggregationMonoid>, }, WeightedPathQuery { rpq_source: String, start_vertex: u64, graph: String, weight_property: String, default_edge_weight: f64, max_hops: usize, predicate: PathWeightPredicate, predicate_selectivity: f64, score: f64, }, MessagePassing { source: Box<OperatorTree>, }, GraphEmbedding { source: Box<OperatorTree>, }, PageRank { graph: String, }, HITS { graph: String, }, BetweennessCentrality { graph: String, }, TextSimilarityJoin { left: Box<OperatorTree>, right: Box<OperatorTree>, threshold: f64, }, VectorSimilarityJoin { left: Box<OperatorTree>, right: Box<OperatorTree>, threshold: f64, }, HybridJoin { left: Box<OperatorTree>, right: Box<OperatorTree>, }, CrossParadigmJoin { left: Box<OperatorTree>, right: Box<OperatorTree>, }, TemporalTraverse { start_vertex: u64, graph: String, label: Option<String>, max_hops: usize, temporal_filter: Option<TemporalFilterIR>, }, TemporalPatternMatch { pattern: GraphPatternIR, graph: String, temporal_filter: Option<TemporalFilterIR>, }, ProgressiveFusion { stages: Vec<ProgressiveFusionEntry>, alpha: f64, gating: GatingSpec, }, DeepFusion { layers: Vec<DeepFusionLayer>, alpha: f64, gating: GatingSpec, }, DeepPredict { model: String, }, Opaque { kind: String, children: Vec<OperatorTree>, meta: BTreeMap<String, Value>, },
}
Expand description

Concrete logical operator tree used by planning and rewrite passes.

Variants§

§

Empty

Empty leaf (no input). The optimizer treats Intersect([]) and Union([]) as empty when checking absorption rules.

§

Term

TermOperator(query_string, field) – text retrieval primitive.

Fields

§query: String
§scoring: Option<TextScoringMode>

Bound by SQL function lowering when a caller explicitly chooses text_match or bayesian_match. Query-string parsers leave this unset so they stay syntax-only.

§top_k: Option<TextTopKPlan>

Physical score-limit selected after logical lowering. None preserves the exhaustive posting-list carrier required by Boolean and fusion parents.

§

Filter

FilterOperator(field, predicate, source).

Fields

§field: String
§predicate: Predicate
§

Facet

FacetOperator(field, source).

Fields

§field: String
§

Score

ScoreOperator(scorer, source, query_terms, field).

Fields

§scorer: ScorerRef
§query_terms: Vec<String>
§field: String
§

BayesianScore

Lucene-style BayesianScoreQuery(source). The source produces one complete raw BM25 query score per matching document, and the wrapper applies the persisted field calibration exactly once.

Fields

§

BayesianMatchWithPrior

Bayesian text retrieval combined with a document authority or recency prior stored in another field.

Fields

§field: String
§query: String
§prior_field: String
§

Intersect(Vec<OperatorTree>)

IntersectOperator([...]).

§

Union(Vec<OperatorTree>)

UnionOperator([...]).

§

Complement(Box<OperatorTree>)

ComplementOperator(operand).

§

Composed(Vec<OperatorTree>)

ComposedOperator([...]).

§

EncodeGraphPosting

Explicitly encode a graph posting carrier into an ordinary posting carrier with the versioned Phi codec. SQL document predicates insert this boundary before combining graph results with relational results; graph-to-graph set algebra remains on GraphPostingList.

Fields

§

VectorSimilarity

VectorSimilarityOperator(query_vector, threshold, field).

Fields

§query_vector: Vec<f32>
§threshold: f32
§field: String
§

KNN

KNNOperator(query_vector, k, field).

Fields

§query_vector: Vec<f32>
§field: String
§

CalibratedVectorMatch

Query-pool vector score transform exposed by the compatibility SQL name calibrated_vector_match. This variant does not claim held-out probability calibration.

Fields

§query_vector: Vec<f32>
§field: String
§threshold: Option<f64>
§

CosineProbability(Box<OperatorTree>)

CosineProbabilityOperator(source) – wraps a KNN child with a unit-interval score projection. This is monotone, not empirically calibrated.

§

BayesianEvidenceFusion

Exact signed-evidence Bayesian fusion. base_rate = None derives one prior from signal metadata and otherwise falls back to the neutral 0.5.

Fields

§base_rate: Option<f64>
§

RobustPositiveEvidencePool

Robust positive-evidence retrieval pool with optional weights and logit normalization. This variant makes no calibration theorem claim.

Fields

§alpha: f64
§gating: GatingSpec
§weights: Option<Vec<f64>>
§logit_min: Option<Vec<f64>>
§logit_max: Option<Vec<f64>>
§adaptive_weights: bool

Derive weights from the score spread of this invocation.

§

ProbBoolFusion

ProbBoolFusionOperator(signals, mode).

Fields

§

ProbNot

ProbNotOperator(signal, default_prob).

Fields

§default_prob: f64
§

AttentionFusion

AttentionFusionOperator(signals, attention, query_features).

Fields

§attention: AttentionRef
§query_features: Vec<f64>
§

LearnedFusion

LearnedFusionOperator(signals, learned).

Fields

§

SparseThreshold

SparseThresholdOperator(source, threshold).

Fields

§threshold: f64
§

Traverse

TraverseOperator(start, graph, label, max_hops, vertex_predicate).

Fields

§start_vertex: u64
§graph: String
§max_hops: usize
§vertex_predicate: Option<VertexPredicate>
§

GraphNeighbors

One-hop graph neighborhood without including the start vertex. This is separate from Traverse(max_hops=1) because SQL graph_neighbors also carries an explicit edge direction and has different start-vertex semantics.

Fields

§vertex: u64
§graph: String
§direction: Direction
§

GraphEdges

Emit graph edges as posting entries keyed by edge id. The payload score carries the optional numeric edge weight.

Fields

§graph: String
§

PatternMatch

PatternMatchOperator(pattern, graph).

Fields

§graph: String
§

RegularPathQuery

RegularPathQueryOperator(expr, start, graph).

Fields

§rpq_source: String
§start_vertex: u64
§graph: String
§

GraphJoin

GraphJoinOperator(left, right, label, graph).

Fields

§graph: String
§

IndexScan

IndexScanOperator(index, field, predicate) – selected by the optimizer when a covering index is cheaper than a full scan.

Fields

§index_name: String
§field: String
§predicate: Predicate
§

Aggregate

AggregateOperator(source, field, monoid).

Fields

§field: String
§

GroupBy

GroupByOperator(source, group_field, agg_field, monoid).

Fields

§group_field: String
§agg_field: String
§

MultiStage

MultiStageOperator(stages=[(child, cutoff), ...]). The cutoff determines the cardinality at the final stage.

Fields

§

MultiFieldSearch

MultiFieldSearchOperator(fields, queries, weights).

Fields

§fields: Vec<String>
§queries: Vec<String>
§weights: Option<Vec<f64>>
§

HybridTextVector

HybridTextVectorOperator(term_op, vector_op, alpha).

Fields

§vector_op: Box<OperatorTree>
§alpha: f64
§

SemanticFilter

SemanticFilterOperator(source, vector_op).

Fields

§vector_op: Box<OperatorTree>
§

VectorExclusion

VectorExclusionOperator(positive, negative_op).

Fields

§positive: Box<OperatorTree>
§negative: Box<OperatorTree>
§

FacetVector

FacetVectorOperator(vector_op, facet_field).

Fields

§vector_op: Box<OperatorTree>
§facet_field: String
§

VertexAggregation

VertexAggregationOperator(source, monoid) – single-row result.

Fields

§

WeightedPathQuery

A bounded regular-path walk filtered by its accumulated edge weight. predicate_selectivity is a planner estimate only; the physical predicate itself is always preserved in predicate.

Fields

§rpq_source: String
§start_vertex: u64
§graph: String
§weight_property: String
§default_edge_weight: f64
§max_hops: usize
§predicate_selectivity: f64
§score: f64
§

MessagePassing

MessagePassingOperator(source, ...) – pass-through cardinality.

Fields

§

GraphEmbedding

GraphEmbeddingOperator(source, ...) – pass-through cardinality.

Fields

§

PageRank

PageRankOperator(graph) – one score per vertex.

Fields

§graph: String
§

HITS

HITSOperator(graph) – one score per vertex.

Fields

§graph: String
§

BetweennessCentrality

BetweennessCentralityOperator(graph) – one score per vertex.

Fields

§graph: String
§

TextSimilarityJoin

TextSimilarityJoinOperator(left, right, threshold).

Fields

§threshold: f64
§

VectorSimilarityJoin

VectorSimilarityJoinOperator(left, right, threshold).

Fields

§threshold: f64
§

HybridJoin

HybridJoinOperator(left, right).

Fields

§

CrossParadigmJoin

CrossParadigmJoinOperator(left, right). Distinct from OperatorTree::GraphJoin: it joins arbitrary operands via a graph traversal step but does not carry an edge label.

Fields

§

TemporalTraverse

TemporalTraverseOperator(start, graph, label, hops, filter).

Fields

§start_vertex: u64
§graph: String
§max_hops: usize
§temporal_filter: Option<TemporalFilterIR>
§

TemporalPatternMatch

TemporalPatternMatchOperator(pattern, graph, filter).

Fields

§graph: String
§temporal_filter: Option<TemporalFilterIR>
§

ProgressiveFusion

ProgressiveFusionOperator(stages=[(signal, k), ...], alpha, gating). The final stage k determines the result cardinality.

Fields

§alpha: f64
§gating: GatingSpec
§

DeepFusion

DeepFusionOperator(layers, alpha, gating).

Fields

§alpha: f64
§gating: GatingSpec
§

DeepPredict

Execute a registered deep model and emit its document scores.

Fields

§model: String
§

Opaque

Catch-all for opaque operators the optimizer should not rewrite.

Fields

§kind: String
§children: Vec<OperatorTree>

Implementations§

Source§

impl OperatorTree

Source

pub fn visit(&self, visitor: &mut impl FnMut(&OperatorTree))

Visit this node and every descendant in pre-order.

The match is intentionally exhaustive so adding a child-bearing IR variant cannot silently create a traversal boundary in planners or engine catalog analysis.

Source

pub fn is_empty(&self) -> bool

True when the operator is structurally empty. The explicit empty node and zero-operand boolean/composition nodes all execute to an empty posting list, so the optimizer must give them the same meaning.

Source

pub fn is_membership_only(&self) -> bool

Whether this subtree observes and produces document membership only.

The classification is intentionally exhaustive: a newly added operator remains payload-bearing until its score and field effects are reviewed. Optimizer laws and physical support-only set operations share this contract so they cannot silently disagree.

Trait Implementations§

Source§

impl Clone for OperatorTree

Source§

fn clone(&self) -> OperatorTree

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.