Package org. partiql. lang. eval. visitors
Types
Allocates registerIds to all aggregate call-sites, storing the allocated registerId in an instance of AggregateRegisterIdMeta.
Assigns aliases to any unspecified PartiqlAst.FromSource.Scan/PartiqlAst.FromSource.Unpivot that does not already have one.
Pre-calculates PartiqlAst.GroupBy aliases, while not changing any that were previously specified, for example:
This transform must execute after GroupByItemAliasVisitorTransform and FromSourceAliasVisitorTransform.
Provides rules for basic AST sanity checks that should be performed before any attempt at further AST processing. This is provided as a distinct PartiqlAst.Visitor so that all other visitors may assume that the AST at least passed the checking performed here.
A simple visitor transformer that provides a pipeline of transformers to be executed in sequential order.
Specifies any previously unspecified select list item aliases.
Desugars SELECT *
by, for example, transforming SELECT * FROM A as x, B as y at i
to SELECT x.*, y.*, i FROM A as x, B as y at i
and transforming SELECT * FROM ... GROUP BY E as x, D as y GROUP as g
to SELECT x, y, g FROM ... GROUP BY E as x, D as y GROUP as g
A PartiqlAst.VisitorTransform that annotates nodes with their static types and resolves implicit variables explicitly based on the static types.
Extra constraints which may be imposed on the type checking.
Coerce each SQL-style SELECT subquery to single value, if it occurs in a context that expects a single value -- as prescribed in SQL for scalar-expecting contexts and as outlined in Chapter 9 of the PartiQL specification. The coercion is done by wrapping each eligible SELECT in a call to the COLL_TO_SCALAR built-in. The coercion is context-dependent, in the sense that not every SELECT is coerced, but only a SELECT subquery in an appropriate context, while its coercion specifics depend on the context as well.
Specifies an individual substitution to be performed by SubstitutionVisitorTransform.
Given a Map (substitutions), replaces every node of the AST that is equivalent to a SubstitutionPair.target with its corresponding SubstitutionPair.replacement.
Base-class for visitor transforms that provides additional functions outside of PartiqlAst.VisitorTransform. These functions are used to avoid infinite recursion when working with nested visitor instances and to change the rewrite order to follow the PartiQL evaluation order.