pub enum HirRelationExpr {
Show 14 variants Constant { rows: Vec<Row>, typ: RelationType, }, Get { id: Id, typ: RelationType, }, Let { name: String, id: LocalId, value: Box<HirRelationExpr>, body: Box<HirRelationExpr>, }, Project { input: Box<HirRelationExpr>, outputs: Vec<usize>, }, Map { input: Box<HirRelationExpr>, scalars: Vec<HirScalarExpr>, }, CallTable { func: TableFunc, exprs: Vec<HirScalarExpr>, }, Filter { input: Box<HirRelationExpr>, predicates: Vec<HirScalarExpr>, }, Join { left: Box<HirRelationExpr>, right: Box<HirRelationExpr>, on: HirScalarExpr, kind: JoinKind, }, Reduce { input: Box<HirRelationExpr>, group_key: Vec<usize>, aggregates: Vec<AggregateExpr>, expected_group_size: Option<usize>, }, Distinct { input: Box<HirRelationExpr>, }, TopK { input: Box<HirRelationExpr>, group_key: Vec<usize>, order_key: Vec<ColumnOrder>, limit: Option<usize>, offset: usize, }, Negate { input: Box<HirRelationExpr>, }, Threshold { input: Box<HirRelationExpr>, }, Union { base: Box<HirRelationExpr>, inputs: Vec<HirRelationExpr>, },
}
Expand description

Just like MirRelationExpr, except where otherwise noted below.

Variants

Constant

Fields

rows: Vec<Row>

Get

Fields

id: Id

Let

Fields

name: String
id: LocalId

The identifier to be used in Get variants to retrieve value.

value: Box<HirRelationExpr>

The collection to be bound to name.

body: Box<HirRelationExpr>

The result of the Let, evaluated with name bound to value.

CTE

Project

Fields

outputs: Vec<usize>

Map

Fields

scalars: Vec<HirScalarExpr>

CallTable

Fields

func: TableFunc

Filter

Fields

predicates: Vec<HirScalarExpr>

Join

Unlike MirRelationExpr, we haven’t yet compiled LeftOuter/RightOuter/FullOuter joins away into more primitive exprs

Reduce

Fields

group_key: Vec<usize>
aggregates: Vec<AggregateExpr>
expected_group_size: Option<usize>

Unlike MirRelationExpr, when key is empty AND input is empty this returns a single row with the aggregates evaluated over empty groups, rather than returning zero rows

Distinct

Fields

TopK

Fields

input: Box<HirRelationExpr>

The source collection.

group_key: Vec<usize>

Column indices used to form groups.

order_key: Vec<ColumnOrder>

Column indices used to order rows within groups.

limit: Option<usize>

Number of records to retain

offset: usize

Number of records to skip

Groups and orders within each group, limiting output.

Negate

Fields

Threshold

Fields

Keep rows from a dataflow where the row counts are positive.

Union

Fields

Implementations

Pretty-print this HirRelationExpr to a string.

Reports whether this expression contains a column reference to its direct parent scope.

👎Deprecated: Use Visit::visit_post.
👎Deprecated: Use Visit::try_visit_post.
👎Deprecated: Use VisitChildren<HirRelationExpr>::try_visit_children instead.
👎Deprecated: Use Visit::visit_mut_post instead.
👎Deprecated: Use Visit::try_visit_mut_post instead.
👎Deprecated: Use VisitChildren<HirRelationExpr>::try_visit_mut_children instead.
👎Deprecated: Use a combination of Visit and VisitChildren methods.

Visits all scalar expressions within the sub-tree of the given relation.

The depth argument should indicate the subquery nesting depth of the expression, which will be incremented when entering the RHS of a join or a subquery and presented to the supplied function f.

👎Deprecated: Use a combination of Visit and VisitChildren methods.

Like visit_scalar_expressions, but permits mutating the expressions.

👎Deprecated: Redefine this based on the Visit and VisitChildren methods.

Visits the column references in this relation expression.

The depth argument should indicate the subquery nesting depth of the expression, which will be incremented when entering the RHS of a join or a subquery and presented to the supplied function f.

👎Deprecated: Redefine this based on the Visit and VisitChildren methods.

Like visit_columns, but permits mutating the column references.

Replaces any parameter references in the expression with the corresponding datum from params.

See the documentation for HirScalarExpr::splice_parameters.

Constructs a constant collection from specific rows and schema.

Rewrite self into a mz_expr::MirRelationExpr. This requires rewriting all correlated subqueries (nested HirRelationExprs) into flat queries

Return a mz_expr::MirRelationExpr which evaluates self once for each row of get_outer.

For uncorrelated self, this should be the cross-product between get_outer and self. When self references columns of get_outer, much more work needs to occur.

The col_map argument contains mappings to some of the columns of get_outer, though perhaps not all of them. It should be used as the basis of resolving column references, but care must be taken when adding new columns that get_outer.arity() is where they will start, rather than any function of col_map.

The get_outer expression should be a Get with no duplicate rows, describing the distinct assignment of values to outer rows.

Perform optimizing algebraic rewrites on this HirRelationExpr and lower it to a mz_expr::MirRelationExpr.

The optimization path is fully-determined by the values of the feature flag defined in the OptimizerConfig.

Attempt an optimization path from HIR to MIR that goes through a QGM representation.

Return Result::Err if the path is not possible.

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
Deserialize this value from the given Serde deserializer. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. 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.
Apply an infallible immutable function f to each direct child.
Apply an infallible mutable function f to each direct child.
Apply a fallible immutable function f to each direct child. Read more
Apply a fallible mutable function f to each direct child. Read more
Apply an infallible immutable function f to each direct child.
Apply an infallible mutable function f to each direct child.
Apply a fallible immutable function f to each direct child. Read more
Apply a fallible mutable function f to each direct child. Read more

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
Compare self to key and return true if they are equal.

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
The type of the output value.
A well-distributed integer derived from the data.
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
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.
source

fn visit_post<F>(&self, f: &mut F) -> Result<(), RecursionLimitError>where
    F: FnMut(&T),

Post-order immutable infallible visitor for self.
source

fn visit_post_nolimit<F>(&self, f: &mut F)where
    F: FnMut(&T),

👎Deprecated: Use visit_post instead.
Post-order immutable infallible visitor for self. Does not enforce a recursion limit. Read more
source

fn visit_mut_post<F>(&mut self, f: &mut F) -> Result<(), RecursionLimitError>where
    F: FnMut(&mut T),

Post-order mutable infallible visitor for self.
source

fn visit_mut_post_nolimit<F>(&mut self, f: &mut F)where
    F: FnMut(&mut T),

👎Deprecated: Use visit_mut_post instead.
Post-order mutable infallible visitor for self. Does not enforce a recursion limit. Read more
source

fn try_visit_post<F, E>(&self, f: &mut F) -> Result<(), E>where
    F: FnMut(&T) -> Result<(), E>,
    E: From<RecursionLimitError>,

Post-order immutable fallible visitor for self.
source

fn try_visit_mut_post<F, E>(&mut self, f: &mut F) -> Result<(), E>where
    F: FnMut(&mut T) -> Result<(), E>,
    E: From<RecursionLimitError>,

Post-order mutable fallible visitor for self.
Pre-order immutable infallible visitor for self.
👎Deprecated: Use visit_pre instead.
Pre-order immutable infallible visitor for self. Does not enforce a recursion limit. Read more
Pre-order mutable infallible visitor for self.
👎Deprecated: Use visit_mut_pre instead.
Pre-order mutable infallible visitor for self. Does not enforce a recursion limit. Read more
Pre-order immutable fallible visitor for self.
Pre-order mutable fallible visitor for self.
source

fn visit_pre_post<F1, F2>(
    &self,
    pre: &mut F1,
    post: &mut F2
) -> Result<(), RecursionLimitError>where
    F1: FnMut(&T) -> Option<Vec<&T, Global>>,
    F2: FnMut(&T),

source

fn visit_pre_post_nolimit<F1, F2>(&self, pre: &mut F1, post: &mut F2)where
    F1: FnMut(&T) -> Option<Vec<&T, Global>>,
    F2: FnMut(&T),

👎Deprecated: Use visit instead.
A generalization of Visit::visit_pre and Visit::visit_post. Does not enforce a recursion limit. Read more
source

fn visit_mut_pre_post<F1, F2>(
    &mut self,
    pre: &mut F1,
    post: &mut F2
) -> Result<(), RecursionLimitError>where
    F1: FnMut(&mut T) -> Option<Vec<&mut T, Global>>,
    F2: FnMut(&mut T),

👎Deprecated: Use visit_mut instead.
source

fn visit_mut_pre_post_nolimit<F1, F2>(&mut self, pre: &mut F1, post: &mut F2)where
    F1: FnMut(&mut T) -> Option<Vec<&mut T, Global>>,
    F2: FnMut(&mut T),

👎Deprecated: Use visit_mut_pre_post instead.
A generalization of Visit::visit_mut_pre and Visit::visit_mut_post. Does not enforce a recursion limit. Read more
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