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
Represents a PartiQL bag expression, e.g.
<<a.c * 2, 5>>.Represents a PartiQL
BETWEEN expression, e.g. BETWEEN 500 AND 600.Represents a
CALL expression (i.e., a function call), e.g. LOWER("ALL CAPS").Represents a
COALESCE expression, e.g.
COALESCE(NULL, 10) in SELECT COALESCE(NULL, 10) FROM data.Represents an expression query e.g.
a * 2 in a * 2 or an expression like 2+2.Represents an
IS expression, e.g. IS TRUE.[’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`.Represents a PartiQL list expression, e.g.
[a.c * 2, 5].Represents a PartiQL logical plan.
Represents a
NULLIF expression, e.g. NULLIF(v1, v2) in SELECT NULLIF(v1, v2) FROM data.Represents an operator identifier in a
LogicalPlanRepresents a PartiQL Pattern Match expression, e.g.
'foo' LIKE 'foo'.Represents a projection, e.g.
SELECT a in SELECT a FROM t.Represents a value projection (SELECT VALUE) e.g.
SELECT VALUE t.a * 2 in
SELECT VALUE t.a * 2 IN tbl AS t.Represents a PartiQL’s searched case expressions,
e.g.
CASE [ WHEN <expr> THEN <expr> ]... [ ELSE <expr> ] END.Represents a PartiQL’s simple case expressions,
e.g.
CASE <expr> [ WHEN <expr> THEN <expr> ]... [ ELSE <expr> ] END.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 sRepresents a PartiQL tuple expression, e.g:
{ a.b: a.c * 2, 'count': a.c + 10}.Enums
Represents logical plan’s binary operators.
Represents PartiQL binding operators; A
BindingOp is an operator that operates on
binding tuples as specified by PartiQL Specification 2019.Represents a known function.
Represents join types.
Represents a path component in a plan.
Represents a PartiQL Type.
Represents logical plan’s unary operators.
Represents a PartiQL value expression. Evaluation of a
ValueExpr leads to a PartiQL value as
specified by PartiQL Specification 2019.