Crate partiql_logical

Source
Expand description

A PartiQL logical plan.

This module contains the structures for a PartiQL logical plan. Three main entities in the module are LogicalPlan, BindingsOp, and ValueExpr. LogicalPlan represents a graph based logical plan. BindingsOp represent operations that operate on binding tuples and ValueExpr represents PartiQL expressions that produce PartiQL values; all as specified in PartiQL Specification 2019.

Plan graph nodes are called operators and edges are called flows re-instating the fact that the plan captures data flows for a given PartiQL statement.

Structs§

AggregateExpression
An SQL aggregation function call with its arguments
BagExpr
Represents a PartiQL bag expression, e.g. <<a.c * 2, 5>>.
BagOp
BagOp represents a bag operator, e.g. UNION ALL in SELECT a, b FROM foo UNION ALL SELECT c, d FROM bar.
BetweenExpr
Represents a PartiQL BETWEEN expression, e.g. BETWEEN 500 AND 600.
CallExpr
Represents a CALL expression (i.e., a function call), e.g. LOWER("ALL CAPS").
CoalesceExpr
Represents a COALESCE expression, e.g. COALESCE(NULL, 10) in SELECT COALESCE(NULL, 10) FROM data.
ExprQuery
Represents an expression query e.g. a * 2 in a * 2 or an expression like 2+2.
Filter
Filter represents a filter operator, e.g. WHERE a = 10 in SELECT a FROM t WHERE a = 10.
GroupBy
Represents GROUP BY <group_key>[, <group_key>] … [AS <as_alias>]
Having
Having represents the having operator, e.g. HAVING a = 10 in SELECT b FROM t GROUP BY a, b HAVING a = 10.
IsTypeExpr
Represents an IS expression, e.g. IS TRUE.
Join
[’Join] represents a join operator, e.g. implicit CROSS JOINspecified by comma inFROMclause inSELECT t1.a, t2.b FROM tbl1 AS t1, tbl2 AS t2`.
LikeMatch
Represents a LIKE expression where both the pattern and escape are string literals, e.g. 'foo%' ESCAPE '/'
LikeNonStringNonLiteralMatch
Represents a LIKE expression where one of pattern and escape is not a string literal, e.g. some_pattern ESCAPE '/'
LimitOffset
LimitOffset represents a possible limit and/or offset operator, e.g. LIMIT 10 OFFSET 5 in SELECT a FROM t LIMIT 10 OFFSET 5.
ListExpr
Represents a PartiQL list expression, e.g. [a.c * 2, 5].
LogicalPlan
Represents a PartiQL logical plan.
NullIfExpr
Represents a NULLIF expression, e.g. NULLIF(v1, v2) in SELECT NULLIF(v1, v2) FROM data.
OpId
Represents an operator identifier in a LogicalPlan
OrderBy
OrderBy represents a sort operatyion, e.g. ORDER BY a DESC NULLS LAST in SELECT a FROM t ORDER BY a DESC NULLS LAST.
PatternMatchExpr
Represents a PartiQL Pattern Match expression, e.g. 'foo' LIKE 'foo'.
Pivot
Pivot represents a PIVOT operator, e.g. PIVOT sp.price AT sp."symbol in PIVOT sp.price AT sp."symbol" FROM todaysStockPrices sp. For Pivot operational semantics, see section 6.2 of PartiQL Specification — August 1, 2019.
Project
Represents a projection, e.g. SELECT a in SELECT a FROM t.
ProjectValue
Represents a value projection (SELECT VALUE) e.g. SELECT VALUE t.a * 2 in SELECT VALUE t.a * 2 IN tbl AS t.
Scan
Scan bridges from ValueExprs to BindingsOps.
SearchedCase
Represents a PartiQL’s searched case expressions, e.g.CASE [ WHEN <expr> THEN <expr> ]... [ ELSE <expr> ] END.
SimpleCase
Represents a PartiQL’s simple case expressions, e.g.CASE <expr> [ WHEN <expr> THEN <expr> ]... [ ELSE <expr> ] END.
SortSpec
Represents a PartiQL sort specification.
SubQueryExpr
Represents a sub-query expression, e.g. SELECT v.a*2 AS u FROM t AS v in SELECT t.a, s FROM data AS t, (SELECT v.a*2 AS u FROM t AS v) AS s
TupleExpr
Represents a PartiQL tuple expression, e.g: { a.b: a.c * 2, 'count': a.c + 10}.
Unpivot
Unpivot bridges from ValueExprs to BindingsOps.

Enums§

AggFunc
SQL aggregate function
BagOperator
Represents the supported bag operator types.
BinaryOp
Represents logical plan’s binary operators.
BindingsOp
Represents PartiQL binding operators; A BindingOp is an operator that operates on binding tuples as specified by PartiQL Specification 2019.
CallName
Represents a known function.
GroupingStrategy
Grouping qualifier: ALL or PARTIAL
JoinKind
Represents join types.
PathComponent
Represents a path component in a plan.
Pattern
SetQuantifier
Indicates if a set should be reduced to its distinct elements or not.
SortSpecNullOrder
SortSpecOrder
Type
Represents a PartiQL Type.
UnaryOp
Represents logical plan’s unary operators.
ValueExpr
Represents a PartiQL value expression. Evaluation of a ValueExpr leads to a PartiQL value as specified by PartiQL Specification 2019.
VarRefType
Indicates whether to look in the local/lexical or global environment when resolving a variable.