Package org.partiql.lang.eval.visitors

Types

Link copied to clipboard
class AggregateSupportVisitorTransform : VisitorTransformBase

Allocates registerIds to all aggregate call-sites, storing the allocated registerId in an instance of AggregateRegisterIdMeta.

Link copied to clipboard
class FromSourceAliasVisitorTransform : VisitorTransformBase

Assigns aliases to any unspecified PartiqlAst.FromSource.Scan/PartiqlAst.FromSource.Unpivot that does not already have one.

Link copied to clipboard
class GroupByItemAliasVisitorTransform(nestLevel: Int) : VisitorTransformBase

Pre-calculates PartiqlAst.GroupBy aliases, while not changing any that were previously specified, for example:

Link copied to clipboard
class GroupByPathExpressionVisitorTransform(parentSubstitutions: Map<PartiqlAst.Expr, SubstitutionPair>) : SubstitutionVisitorTransform
Link copied to clipboard
class PartiqlAstSanityValidator : PartiqlAst.Visitor

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.

Link copied to clipboard
class PipelinedVisitorTransform(transformers: PartiqlAst.VisitorTransform) : PartiqlAst.VisitorTransform

A simple visitor transformer that provides a pipeline of transformers to be executed in sequential order.

Link copied to clipboard

Specifies any previously unspecified select list item aliases.

Link copied to clipboard
class SelectStarVisitorTransform : VisitorTransformBase

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

Link copied to clipboard
class StaticTypeVisitorTransform(ion: IonSystem, globalBindings: Bindings<StaticType>, constraints: Set<StaticTypeVisitorTransformConstraints>) : VisitorTransformBase

A PartiqlAst.VisitorTransform that annotates nodes with their static types and resolves implicit variables explicitly based on the static types.

Link copied to clipboard

Extra constraints which may be imposed on the type checking.

Link copied to clipboard
class SubqueryCoercionVisitorTransform : VisitorTransformBase

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.

Link copied to clipboard
data class SubstitutionPair(target: PartiqlAst.Expr, replacement: PartiqlAst.Expr)

Specifies an individual substitution to be performed by SubstitutionVisitorTransform.

Link copied to clipboard
open class SubstitutionVisitorTransform(substitutions: Map<PartiqlAst.Expr, SubstitutionPair>) : VisitorTransformBase

Given a Map (substitutions), replaces every node of the AST that is equivalent to a SubstitutionPair.target with its corresponding SubstitutionPair.replacement.

Link copied to clipboard
abstract class VisitorTransformBase : PartiqlAst.VisitorTransform

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.

Functions

Link copied to clipboard
fun basicVisitorTransforms(): PipelinedVisitorTransform

AST Normalization Passes.