pub(crate) enum BoxScalarExpr {
    ColumnReference(ColumnReference),
    BaseColumn(BaseColumn),
    Literal(RowColumnType),
    CallUnmaterializable(UnmaterializableFunc),
    CallUnary {
        func: UnaryFunc,
        expr: Box<BoxScalarExpr>,
    },
    CallBinary {
        func: BinaryFunc,
        expr1: Box<BoxScalarExpr>,
        expr2: Box<BoxScalarExpr>,
    },
    CallVariadic {
        func: VariadicFunc,
        exprs: Vec<BoxScalarExpr>,
    },
    If {
        cond: Box<BoxScalarExpr>,
        then: Box<BoxScalarExpr>,
        els: Box<BoxScalarExpr>,
    },
    Aggregate {
        func: AggregateFunc,
        expr: Box<BoxScalarExpr>,
        distinct: bool,
    },
}
Expand description

Representation for scalar expressions within a query graph model.

Similar to HirScalarExpr but:

  • subqueries are represented as column references to the subquery quantifiers within the same box the expression belongs to,
  • aggregate expressions are considered scalar expressions here even though they are only valid in the context of a Grouping box,
  • column references are represented by a pair (quantifier ID, column position),
  • BaseColumn is used to represent leaf columns, only allowed in the projection of BaseTables and TableFunctions.

Scalar expressions only make sense within the context of a super::graph::QueryBox, and hence, their name.

Variants§

§

ColumnReference(ColumnReference)

A reference to a column from a quantifier that either lives in the same box as the expression or is a sibling quantifier of an ascendent box of the box that contains the expression.

§

BaseColumn(BaseColumn)

A leaf column. Only allowed as standalone expressions in the projection of BaseTable and TableFunction boxes.

§

Literal(RowColumnType)

A literal value. (A single datum stored as a row, because we can’t own a Datum)

§

CallUnmaterializable(UnmaterializableFunc)

§

CallUnary

Fields

§

CallBinary

Fields

§

CallVariadic

Fields

§

If

§

Aggregate

Fields

§func: AggregateFunc

Names the aggregation function.

§expr: Box<BoxScalarExpr>

An expression which extracts from each row the input to func.

§distinct: bool

Should the aggregation be applied only to distinct results in each group.

Implementations§

source

pub fn try_visit_pre_post<F1, F2>(&self, pre: &mut F1, post: &mut F2)where
    F1: FnMut(&Self) -> Option<Vec<&Self>>,
    F2: FnMut(&Self),

A generalization of visit. The function pre runs on a BoxScalarExpr before it runs on any of the child BoxScalarExprs. The function post runs on child BoxScalarExprs first before the parent. Optionally, pre can return which child BoxScalarExprs, if any, should be visited (default is to visit all children).

source

pub fn visit_post<F>(&self, f: &mut F)where
    F: FnMut(&Self),

source

pub fn visit_mut_post<F>(&mut self, f: &mut F)where
    F: FnMut(&mut Self),

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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
Formats an object with the “alternative” format ({:#}) and returns it.

Returns the argument unchanged.

Converts to this type from a reference to the input type.
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
Upcasts this ProgressEventTimestamp to Any. Read more
Returns the name of the concrete type of this object. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
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