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
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).
Facet
FacetOperator(field, source).
Score
ScoreOperator(scorer, source, query_terms, field).
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.
BayesianMatchWithPrior
Bayesian text retrieval combined with a document authority or recency prior stored in another field.
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
source: Box<OperatorTree>VectorSimilarity
VectorSimilarityOperator(query_vector, threshold, field).
KNN
KNNOperator(query_vector, k, field).
CalibratedVectorMatch
Query-pool vector score transform exposed by the compatibility SQL
name calibrated_vector_match. This variant does not claim held-out
probability calibration.
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.
RobustPositiveEvidencePool
Robust positive-evidence retrieval pool with optional weights and logit normalization. This variant makes no calibration theorem claim.
ProbBoolFusion
ProbBoolFusionOperator(signals, mode).
ProbNot
ProbNotOperator(signal, default_prob).
AttentionFusion
AttentionFusionOperator(signals, attention, query_features).
LearnedFusion
LearnedFusionOperator(signals, learned).
SparseThreshold
SparseThresholdOperator(source, threshold).
Traverse
TraverseOperator(start, graph, label, max_hops, vertex_predicate).
Fields
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.
GraphEdges
Emit graph edges as posting entries keyed by edge id. The payload score carries the optional numeric edge weight.
PatternMatch
PatternMatchOperator(pattern, graph).
RegularPathQuery
RegularPathQueryOperator(expr, start, graph).
GraphJoin
GraphJoinOperator(left, right, label, graph).
IndexScan
IndexScanOperator(index, field, predicate) – selected by the
optimizer when a covering index is cheaper than a full scan.
Aggregate
AggregateOperator(source, field, monoid).
GroupBy
GroupByOperator(source, group_field, agg_field, monoid).
MultiStage
MultiStageOperator(stages=[(child, cutoff), ...]). The cutoff
determines the cardinality at the final stage.
Fields
stages: Vec<MultiStageEntry>MultiFieldSearch
MultiFieldSearchOperator(fields, queries, weights).
HybridTextVector
HybridTextVectorOperator(term_op, vector_op, alpha).
SemanticFilter
SemanticFilterOperator(source, vector_op).
VectorExclusion
VectorExclusionOperator(positive, negative_op).
FacetVector
FacetVectorOperator(vector_op, facet_field).
VertexAggregation
VertexAggregationOperator(source, monoid) – single-row result.
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
predicate: PathWeightPredicateMessagePassing
MessagePassingOperator(source, ...) – pass-through cardinality.
Fields
source: Box<OperatorTree>GraphEmbedding
GraphEmbeddingOperator(source, ...) – pass-through cardinality.
Fields
source: Box<OperatorTree>PageRank
PageRankOperator(graph) – one score per vertex.
HITS
HITSOperator(graph) – one score per vertex.
BetweennessCentrality
BetweennessCentralityOperator(graph) – one score per vertex.
TextSimilarityJoin
TextSimilarityJoinOperator(left, right, threshold).
VectorSimilarityJoin
VectorSimilarityJoinOperator(left, right, threshold).
HybridJoin
HybridJoinOperator(left, right).
CrossParadigmJoin
CrossParadigmJoinOperator(left, right). Distinct from
OperatorTree::GraphJoin: it joins arbitrary operands via a
graph traversal step but does not carry an edge label.
TemporalTraverse
TemporalTraverseOperator(start, graph, label, hops, filter).
Fields
temporal_filter: Option<TemporalFilterIR>TemporalPatternMatch
TemporalPatternMatchOperator(pattern, graph, filter).
ProgressiveFusion
ProgressiveFusionOperator(stages=[(signal, k), ...], alpha, gating).
The final stage k determines the result cardinality.
DeepFusion
DeepFusionOperator(layers, alpha, gating).
DeepPredict
Execute a registered deep model and emit its document scores.
Opaque
Catch-all for opaque operators the optimizer should not rewrite.
Implementations§
Source§impl OperatorTree
impl OperatorTree
Sourcepub fn visit(&self, visitor: &mut impl FnMut(&OperatorTree))
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.
Sourcepub fn is_empty(&self) -> bool
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.
Sourcepub fn is_membership_only(&self) -> bool
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
impl Clone for OperatorTree
Source§fn clone(&self) -> OperatorTree
fn clone(&self) -> OperatorTree
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more