Struct mz_sql::query_model::mir::Lowerer

source ·
struct Lowerer<'a> {
    model: &'a Model,
    id_gen: IdGen,
    lets: Vec<(LocalId, MirRelationExpr)>,
    common_boxes: HashMap<BoxId, usize>,
}

Fields§

§model: &'a Model§id_gen: IdGen

Generates mz_expr::LocalId as an alias for common expressions.

§lets: Vec<(LocalId, MirRelationExpr)>

Stack of common expressions that have been given a mz_expr::LocalId.

§common_boxes: HashMap<BoxId, usize>

Map of (BoxIds whose MIR representation has been given a mz_expr::LocalId) -> (position of its MIR representation in lets)

Implementations§

Pushes a relation to the stack of common expressions.

If rel is a mz_expr::MirRelationExpr::Get, it does not get added to the stack.

Returns

Converts self.model to a mz_expr::MirRelationExpr.

Applies the given box identified by its ID to the given outer relation.

Generates a join among the result of applying the outer relation to the given quantifiers. Returns a relation and a map of column references that can be used to lower expressions that sit directly on top of the join.

The quantifiers are joined on the columns of the outer relation. TODO(asenac) Since decorrelation is not yet supported the outer relation is currently always the join identity, so the result of this method is always a cross-join of the given quantifiers, which makes part of this code untesteable at the moment.

Same as lower_join except the outer relation has already been applied to the quantifiers.

Lowers the given quantifier by applying it to the outer relation.

Join the given inputs on a shared common prefix.

TODO(asenac) Given the lack of support for decorrelation at the moment, this method is always called with prefix_length 0, and hence, it remains untested.

Lowers a scalar expression, resolving the column references using the supplied column map.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Attaches the current Context to this type, returning a WithContext wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Wrap the input message T in a tonic::Request
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more