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 CustomTypeVisitorTransform : VisitorTransformBase

Transforms all the hard-coded type-nodes in the AST to PartiqlAst.Type.CustomType. It is used only after deserializing the old persisted ASTs to make them compatible with the new version of the PIG AST. It should be non-existent once the persisted ASTs are migrated to the new version of PIG AST. The tests for this visitor transform are covered in SqlParserCustomTypeCatalogTests.kt TODO: Remove this VisitorTransform once https://github.com/partiql/partiql-lang-kotlin/issues/510 is resolved.

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 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

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
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
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

Returns a PartiqlAst.VisitorTransform requiring no external state for the basic functionality of compiling PartiQL queries.