Expand description
Modules§
- error π
- explain π
EXPLAIN
support for structures defined in this crate. - expr πThis file houses a representation of a SQL plan that is parallel to that found in src/expr/relation/mod.rs, but represents an earlier phase of planning. Itβs structurally very similar to that file, with some differences which are noted below. It gets turned into that representation via a call to lower().
- literal π
- lowering πLowering is the process of transforming a
HirRelationExpr
into aMirRelationExpr
. - notice π
- plan_
utils πHelper code used throughout the planner. - query πSQL
Query
s are the declarative, computational part of SQL. This module turnsQuery
s intoHirRelationExpr
s - a more explicit, algebraic way of describing computation. Functions named plan_* are typically responsible for handling a single node of the SQL ast. Egplan_query
is responsible for handlingsqlparser::ast::Query
. plan_* functions which correspond to operations on relations typically return aHirRelationExpr
. plan_* functions which correspond to operations on scalars typically return aHirScalarExpr
and aScalarType
. (The latter is because itβs not always possible to infer from aHirScalarExpr
what the intended type is - notably in the case of decimals where the scale/precision are encoded only in the type). Aggregates are particularly twisty. - scope πHandles SQLβs scoping rules.
- side_
effecting_ πfunc Support for side-effecting functions. - statement πStatement planning.
- transform_
ast πTransformations of SQL ASTs. - transform_
expr πTransformations of SQL IR, before decorrelation. - typeconv πMaintains a catalog of valid casts between
mz_repr::ScalarType
s, as well as other cast-related functions. - with_
options πProvides tooling to handleWITH
options.
Structs§
- Generated by
ALTER ... IF EXISTS
if the named object did not exist. - Configuration of introspection for a cluster replica.
- A
CreateSourcePlan
and the metadata necessary to sequence it. - A bundle of unrelated things that we need for planning
Expr
s. - A vector of values to which parameter references should be bound.
- Controls planning of a SQL query.
- The state required when planning a
Query
. - A plan for select statements.
- An available external reference for a source and if possible to retrieve, any column names it contains.
- Immutable state that applies to the planning of an entire
Statement
. - Describes the output of a SQL statement.
Enums§
- A
CoercibleScalarExpr
is aHirScalarExpr
whose type is not fully determined. Several SQL expressions can be freely coerced based upon where in the expression tree they appear. For example, the string literal β42β will be automatically coerced to the integer 42 if used in a numeric context: - The type of object to be explained
- Explainee types that are statements.
- Just like
mz_expr::MirRelationExpr
, except where otherwise noted below. - Just like
mz_expr::MirScalarExpr
, except where otherwise noted below. - Instructions for executing a SQL query.
- Notices that can occur in the adapter layer.
- Specifies how long a query will live.
- Specifies when a
Peek
orSubscribe
should occur. - A side-effecting function is a function whose evaluation triggers side effects.
- Statement classification as documented by
plan
. - A window function with its parameters.
Constants§
Functions§
- Creates a description of the purified statement
stmt
. - Normalize the way subqueries appear in
HirScalarExpr::Exists
orHirScalarExpr::Select
variants. - Produces a
Plan
from the purified statementstmt
.