use super::super::PhysicalPlan;
use crate::OptimizerContext;
use hawdb_plan_cypher::LogicalPlan;
use super::{access, ddl, mutation, procedure, traversal};
pub(super) fn lower_simple_logical(
logical: &LogicalPlan,
optimizer_context: &OptimizerContext,
) -> Option<PhysicalPlan> {
if let LogicalPlan::Unwind { rows, variable } = logical {
return Some(PhysicalPlan::UnwindExec {
rows: rows.clone(),
variable: variable.clone(),
});
}
ddl::lower(logical)
.or_else(|| mutation::lower(logical))
.or_else(|| access::lower(logical))
.or_else(|| traversal::lower(logical))
.or_else(|| procedure::lower(logical, optimizer_context))
}