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.
Modules§
Structs§
- Aggregate
Expression - An SQL aggregation function call with its arguments
- BagExpr
- Represents a
PartiQLbag expression, e.g.<<a.c * 2, 5>>. - BagOp
BagOprepresents a bag operator, e.g.UNION ALLinSELECT a, b FROM foo UNION ALL SELECT c, d FROM bar.- Between
Expr - Represents a
PartiQLBETWEENexpression, e.g.BETWEEN 500 AND 600. - Call
Expr - Represents a
CALLexpression (i.e., a function call), e.g.LOWER("ALL CAPS"). - Coalesce
Expr - Represents a
COALESCEexpression, e.g.COALESCE(NULL, 10)inSELECT COALESCE(NULL, 10) FROM data. - Expr
Query - Represents an expression query e.g.
a * 2ina * 2or an expression like2+2. - Filter
Filterrepresents a filter operator, e.g.WHERE a = 10inSELECT a FROM t WHERE a = 10.- Graph
Match Expr - Represents a
PartiQLGPML expression, e.g.graph MATCH (node1:NodeLabel) -> (node2:OtherLabel). - Graph
Path Pattern - GroupBy
- Represents
GROUP BY< group_key>[, <group_key>] … [AS <as_alias>] - Having
Havingrepresents the having operator, e.g.HAVING a = 10inSELECT b FROM t GROUP BY a, b HAVING a = 10.- IsType
Expr - Represents an
ISexpression, e.g.IS TRUE. - Join
- [’Join
] represents a join operator, e.g. implicitCROSS JOINspecified by comma inFROMclause inSELECT t1.a, t2.b FROM tbl1 AS t1, tbl2 AS t2`. - Like
Match - Represents a LIKE expression where both the
patternandescapeare string literals, e.g.'foo%' ESCAPE '/' - Like
NonString NonLiteral Match - Represents a LIKE expression where one of
patternandescapeis not a string literal, e.g.some_pattern ESCAPE '/' - Limit
Offset LimitOffsetrepresents a possible limit and/or offset operator, e.g.LIMIT 10 OFFSET 5inSELECT a FROM t LIMIT 10 OFFSET 5.- List
Expr - Represents a
PartiQLlist expression, e.g.[a.c * 2, 5]. - Logical
Plan - Represents a
PartiQLlogical plan. - Null
IfExpr - Represents a
NULLIFexpression, e.g.NULLIF(v1, v2)inSELECT NULLIF(v1, v2) FROM data. - OpId
- Represents an operator identifier in a
LogicalPlan - OrderBy
OrderByrepresents a sort operatyion, e.g.ORDER BY a DESC NULLS LASTinSELECT a FROM t ORDER BY a DESC NULLS LAST.- Pattern
Match Expr - Represents a
PartiQLPattern Match expression, e.g.'foo' LIKE 'foo'. - Pivot
Pivotrepresents a PIVOT operator, e.g.PIVOT sp.price AT sp."symbolinPIVOT sp.price AT sp."symbol" FROM todaysStockPrices sp. ForPivotoperational semantics, see section6.2of PartiQL Specification — August 1, 2019.- Project
- Represents a projection, e.g.
SELECT ainSELECT a FROM t. - Project
Value - Represents a value projection (SELECT VALUE) e.g.
SELECT VALUE t.a * 2inSELECT VALUE t.a * 2 IN tbl AS t. - Scan
Scanbridges fromValueExprs toBindingsOps.- Searched
Case - Represents a
PartiQL’s searched case expressions, e.g.CASE [ WHEN <expr> THEN <expr> ]... [ ELSE <expr> ] END. - Simple
Case - Represents a
PartiQL’s simple case expressions, e.g.CASE <expr> [ WHEN <expr> THEN <expr> ]... [ ELSE <expr> ] END. - Sort
Spec - Represents a
PartiQLsort specification. - SubQuery
Expr - Represents a sub-query expression, e.g.
SELECT v.a*2 AS u FROM t AS vinSELECT t.a, s FROM data AS t, (SELECT v.a*2 AS u FROM t AS v) AS s - Tuple
Expr - Represents a
PartiQLtuple expression, e.g:{ a.b: a.c * 2, 'count': a.c + 10}. - Unpivot
Unpivotbridges fromValueExprs toBindingsOps.
Enums§
- AggFunc
- SQL aggregate function
- BagOperator
- Represents the supported bag operator types.
- Binary
Op - Represents logical plan’s binary operators.
- Bindings
Op - Represents
PartiQLbinding operators; ABindingOpis an operator that operates on binding tuples as specified by PartiQL Specification 2019. - Call
Name - Represents a known function.
- Grouping
Strategy - Grouping qualifier: ALL or PARTIAL
- Join
Kind - Represents join types.
- Lit
- Represents a
PartiQLliteral value. - Path
Component - Represents a path component in a plan.
- Pattern
- Project
AllMode - SetQuantifier
- Indicates if a set should be reduced to its distinct elements or not.
- Sort
Spec Null Order - Sort
Spec Order - Type
- Represents a
PartiQLType. - UnaryOp
- Represents logical plan’s unary operators.
- Value
Expr - Represents a
PartiQLvalue expression. Evaluation of aValueExprleads to aPartiQLvalue as specified by PartiQL Specification 2019. - VarRef
Type - Indicates whether to look in the local/lexical or global environment when resolving a variable.