Sign in

    moonrockz/partiql-eval/plan does not have a README file

    EvalError

    pub(all) suberror EvalError {
    TypeError(message~ : String, span~ :
    Span
    )
    DataError(message~ : String, span~ :
    Span
    )
    Unsupported(message~ : String, span~ :
    Span
    )
    Syntax(
    ParseError
    )
    } derive(Eq,
    Debug
    )

    An evaluation failure with a source location, or the original parse error. TypeError is a strict-mode operand failure; DataError is invalid data or a static error in either mode; Unsupported is an unimplemented form.

    AggregateKind

    pub(all) enum AggregateKind {
    Count
    Sum
    Avg
    Min
    Max
    Any
    Every
    } derive(Eq,
    Debug
    )

    An aggregate function (spec M4c §3.3). SOME is Any.

    Expr

    pub(all) enum Expr {
    Const(
    Value
    ,
    Span
    )
    Global(String, delimited~ : Bool,
    Span
    )
    ListOf(Array[Expr],
    Span
    )
    BagOf(Array[Expr],
    Span
    )
    TupleOf(Array[(Expr, Expr)],
    Span
    )
    MapOf(Array[(Expr, Expr)], key_type~ :
    MapType
    ?, value_type~ :
    MapType
    ?,
    Span
    )
    Path(Expr, Array[Step],
    Span
    )
    IsNull(Expr, negated~ : Bool,
    Span
    )
    IsMissing(Expr, negated~ : Bool,
    Span
    )
    Unary(
    UnaryOp
    , Expr,
    Span
    )
    Binary(
    BinaryOp
    , Expr, Expr,
    Span
    )
    And(Expr, Expr,
    Span
    )
    Or(Expr, Expr,
    Span
    )
    Not(Expr,
    Span
    )
    BoolTest(Expr, Bool?, negated~ : Bool,
    Span
    )
    Like(Expr, pattern~ : Expr, escape~ : Expr?, negated~ : Bool,
    Span
    )
    Between(Expr, low~ : Expr, high~ : Expr, negated~ : Bool,
    Span
    )
    In(Expr, Expr, negated~ : Bool,
    Span
    )
    IsType(Expr,
    DataType
    , negated~ : Bool,
    Span
    )
    Case(operand~ : Expr?, branches~ : Array[(Expr, Expr)], default~ : Expr?,
    Span
    )
    Coalesce(Array[Expr],
    Span
    )
    NullIf(Expr, Expr,
    Span
    )
    Call(Function, Array[Expr],
    Span
    )
    Cast(Expr,
    CastTarget
    ,
    Span
    )
    Local(String,
    Span
    )
    GlobalOrLocal(String, variable~ : LocalLookup, delimited~ : Bool,
    Span
    )
    Implicit(String, delimited~ : Bool, locals~ : Array[String],
    Span
    )
    Select(Rel, Projection, distinct~ : Bool,
    Span
    )
    Subquery(Expr, SubqueryUse,
    Span
    )
    Query(Expr, order~ : Array[SortKey], limit~ : Expr?, offset~ : Expr?, aliases~ : Array[String],
    Span
    )
    SetOp(
    SetOpKind
    , all~ : Bool, outer~ : Bool, corresponding~ :
    Corresponding
    ?, Expr, Expr,
    Span
    )
    With(Array[(String, Expr)], Expr,
    Span
    )
    CollAggregate(AggregateKind, distinct~ : Bool, Expr,
    Span
    )
    Aggregate(AggregateKind, distinct~ : Bool, Expr, members~ : Array[String], group~ : String,
    Span
    )
    GlobalsFirst(Array[(String, Bool,
    Span
    )], key~ : Expr, otherwise~ : Expr,
    Span
    )
    } derive(
    Debug
    )

    A lowered scalar expression (spec M4a §3). Names are resolved, literals are values.

    Expr::span

    Where an expression is in the source.

    Function

    pub(all) enum Function {
    CharLength
    OctetLength
    BitLength
    Size
    Cardinality
    Exists
    TupleUnion
    MapGet
    MapContainsKey
    MapKeys
    MapValues
    MapEntries
    Abs
    Mod
    Trim(
    TrimSpec
    )
    Substring
    Position
    Overlay
    TextReplace
    Upper
    Lower
    Extract(
    DatetimeField
    )
    DateAdd(
    DatetimeField
    )
    DateDiff(
    DatetimeField
    )
    Overlaps
    ToString
    ToTimestamp
    CurrentDate
    CurrentTime(Int)
    CurrentTimestamp(Int)
    UtcNow
    } derive(Eq,
    Debug
    )

    A built-in scalar function (spec M4d1). One argument unless a variant says otherwise.

    Function::name

    fn Function::name(self : Function) -> String

    The SQL name, for messages.

    Grouping

    pub(all) enum Grouping {
    All
    By(Array[(String, Expr)])
    } derive(
    Debug
    )

    The keys of a GROUP BY (spec M4c §4).

    Item

    pub(all) enum Item {
    Named(String, Expr)
    AllFields(Expr)
    } derive(
    Debug
    )

    An item of a SELECT list.

    JoinKind

    pub(all) enum JoinKind {
    Cross
    Inner
    Left
    Right
    } derive(Eq,
    Debug
    )

    A lowered join strategy. Left and right outer joins pad unmatched bindings with NULL; cross and inner joins produce only matching pairs.

    LocalLookup

    pub(all) enum LocalLookup {
    Bound(String)
    Ambiguous(Array[String])
    } derive(
    Debug
    )

    The local fallback of a FROM source after global lookup has failed.

    Mode

    pub(all) enum Mode {
    Permissive
    Strict
    } derive(Eq,
    Debug
    )

    How the interpreter handles runtime type failures. Permissive mode yields MISSING; strict mode raises TypeError. Data and unsupported-form failures raise in either mode.

    Projection

    pub(all) enum Projection {
    Value(Expr)
    Items(Array[Item])
    Star(Array[String])
    Pivot(value~ : Expr, key~ : Expr)
    } derive(
    Debug
    )

    What a query block makes of each binding tuple.

    Rel

    pub(all) enum Rel {
    Scan(Expr, as_~ : String, at~ : String?,
    Span
    )
    Unpivot(Expr, as_~ : String, at~ : String?,
    Span
    )
    Filter(Rel, Expr,
    Span
    )
    Join(JoinKind, Rel, Rel, on~ : Expr?,
    Span
    )
    Let(Rel, Array[(String, Expr)],
    Span
    )
    Group(Rel, Grouping, group_as~ : String, members~ : Array[String],
    Span
    )
    } derive(
    Debug
    )

    A relational plan node (spec M4b1 §3): it produces binding tuples.

    Rel::span

    Where a relation is in the source.

    SortKey

    pub(all) struct SortKey {
    expr : Expr
    desc : Bool
    nulls_first : Bool
    } derive(
    Debug
    )

    A key of ORDER BY. nulls_first is resolved: the explicit NULLS FIRST or NULLS LAST, else NULL and MISSING come last for ASC and first for DESC.

    Step

    pub(all) enum Step {
    Field(String, delimited~ : Bool)
    Index(Expr)
    AllElements
    AllFields
    } derive(
    Debug
    )

    One step of a path.

    SubqueryUse

    pub(all) enum SubqueryUse {
    Scalar
    Column
    Row
    } derive(
    Debug
    )

    How a single-column subquery is coerced at its use site. Each variant defines its empty-input and cardinality behavior.

    group_variable

    let group_variable : String

    The group variable of a grouped query without GROUP AS. No identifier can name it.

    output_variable

    fn output_variable(name : String) -> String

    The name of the frame that holds the output name name of a SELECT list while ORDER BY runs: apart from every variable name.

    row_variable

    let row_variable : String

    The variable that holds an output element for the sort keys of a query whose body is not a SELECT. No identifier can name it.

    Source Files