Skip to main content

ExprLowerer

Struct ExprLowerer 

Source
pub struct ExprLowerer<'a> { /* private fields */ }
Expand description

Lowers IR expressions from an ExprArena into DataFusion [Expr] values.

Construct once per plan lowering pass and call lower for each ExprId you need to convert.

Implementations§

Source§

impl<'a> ExprLowerer<'a>

Source

pub fn new( arena: &'a ExprArena, ontology: Option<&'a OntologyHandle>, var_map: &'a VarMap, ) -> Self

Creates a new lowerer, building the PropId → name map from the ontology only (empty in exploratory mode).

  • arena: the expression arena from the [GraphPlan] being lowered.
  • ontology: the ontology handle, if one is loaded (may be None in exploratory mode).
  • var_map: maps variable IDs to DataFusion column name strings.

Prefer with_prop_names when the caller has a map that also covers runtime-catalog (exploratory) property names.

Source

pub fn with_prop_names( arena: &'a ExprArena, var_map: &'a VarMap, prop_names: HashMap<u32, String>, ) -> Self

Creates a lowerer with a prebuilt PropId → name map.

The GraphPlanLowerer builds the map once (merging ontology + runtime catalog) and clones it into each per-operator ExprLowerer (the maps are small).

Source

pub fn with_prop_names_and_nodes( arena: &'a ExprArena, var_map: &'a VarMap, prop_names: HashMap<u32, String>, node_shapes: HashMap<u32, NodeShape>, type_id_to_entity_name: HashMap<u32, String>, props_authoritative: bool, ) -> Self

Like with_prop_names but also seeded with the VarId.0 → NodeShape map for bare-node-value materialization (#785).

props_authoritative is true when node_shapes’ property lists come from a real backing dataset (so an absent property is genuinely absent → null, #598); pass false for schema-only / explain lowering. See the field docs.

Source

pub fn with_input_schema(self, schema: DFSchemaRef) -> Self

Attach the input plan’s schema so a relational op’s PropertyAccess can resolve a temporal-component accessor (d.year) by the base column’s Arrow type (ADR 0009 / #920).

Source

pub fn with_elem_struct_col(self, col: String) -> Self

Push col onto the chain of synthetic per-element columns in scope, so a PropertyAccess on it lowers via struct-aware get_field rather than a dotted property-column name (#1004). Called once per enclosing loop, outermost first, so nested loops keep distinct bindings (#1021).

Source

pub fn with_read_target(self, dir: PathBuf) -> Self

Attach the project directory for read-side lowering, so nodes(p) bakes a hydrating cypher_path_nodes (labels + property union, #1024).

Source

pub fn lower(&self, id: ExprId) -> Result<DfExpr, LoweringError>

Lower the expression identified by id to a DataFusion [Expr].

§Errors

Returns LoweringError if a variable is unbound, a function is unknown, or an expression variant is not yet supported.

Auto Trait Implementations§

§

impl<'a> !Freeze for ExprLowerer<'a>

§

impl<'a> RefUnwindSafe for ExprLowerer<'a>

§

impl<'a> Send for ExprLowerer<'a>

§

impl<'a> Sync for ExprLowerer<'a>

§

impl<'a> Unpin for ExprLowerer<'a>

§

impl<'a> UnsafeUnpin for ExprLowerer<'a>

§

impl<'a> UnwindSafe for ExprLowerer<'a>

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V