use marsdb_graph::PropertyValue;
use crate::ast::{Expr, ReturnExpr};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ExpandDirection {
Out,
In,
Either,
}
#[derive(Debug, Clone, PartialEq)]
pub enum IndexSeekValue {
Fixed(PropertyValue),
RowExpr(ReturnExpr),
}
#[derive(Debug, Clone)]
pub enum LogicalPlan {
AllNodesScan {
var: String,
},
NodeByLabelScan {
var: String,
label: String,
},
IndexSeek {
var: String,
label: String,
prop: String,
value: IndexSeekValue,
},
Seed {
var: String,
},
Expand {
input: Box<LogicalPlan>,
from_var: String,
to_var: String,
rel_var: Option<String>,
rel_labels: Vec<String>,
direction: ExpandDirection,
},
VarExpand {
input: Box<LogicalPlan>,
from_var: String,
to_var: String,
rel_labels: Vec<String>,
direction: ExpandDirection,
min_hops: u32,
max_hops: Option<u32>,
exclude_edge_vars: Vec<String>,
exclude_edge_sets: Vec<String>,
exclude_edge_var: String,
path_segment_var: Option<String>,
rel_list_var: Option<String>,
rel_props: Vec<(String, ReturnExpr)>,
},
MatchRelList {
input: Box<LogicalPlan>,
from_var: String,
to_var: String,
rel_list_var: String,
rel_labels: Vec<String>,
direction: ExpandDirection,
min_hops: u32,
max_hops: Option<u32>,
},
Filter {
input: Box<LogicalPlan>,
predicate: Expr,
},
}