All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.partiql.lang.domains.PartiqlAst.generated.kt Maven / Gradle / Ivy

There is a newer version: 1.0.0-perf.1
Show newest version

/**
 * This code was generated by the PartiQL I.R. Generator.
 * Do not modify this file.  
 */
@file:Suppress("unused", "MemberVisibilityCanBePrivate", "FunctionName",
"CanBePrimaryConstructorProperty", "UNNECESSARY_SAFE_CALL",
"USELESS_ELVIS", "RemoveRedundantQualifierName", "LocalVariableName")

package org.partiql.lang.domains

import com.amazon.ionelement.api.*
import org.partiql.pig.runtime.*


class PartiqlAst private constructor() {
    /////////////////////////////////////////////////////////////////////////////
    // Builder
    /////////////////////////////////////////////////////////////////////////////
    companion object {
        @JvmStatic
        fun BUILDER() : Builder = PartiqlAstBuilder
    
        fun  build(block: Builder.() -> T) =
            PartiqlAstBuilder.block()
    
        fun transform(element: AnyElement): PartiqlAstNode =
            transform(element.asSexp())
    
        fun transform(element: SexpElement): PartiqlAstNode =
            IonElementTransformer().transform(element)
    }
    
    interface Builder {
        fun newMetaContainer() = emptyMetaContainer()
    
        // Tuples 
        /**
         * Creates an instance of [PartiqlAst.TimeValue].
         */
        fun timeValue(
            hour: Long,
            minute: Long,
            second: Long,
            nano: Long,
            precision: Long,
            withTimeZone: Boolean,
            tzMinutes: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.TimeValue =
            PartiqlAst.TimeValue(
                hour = hour.asPrimitive(),
                minute = minute.asPrimitive(),
                second = second.asPrimitive(),
                nano = nano.asPrimitive(),
                precision = precision.asPrimitive(),
                withTimeZone = withTimeZone.asPrimitive(),
                tzMinutes = tzMinutes?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.TimeValue].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun timeValue_(
            hour: org.partiql.pig.runtime.LongPrimitive,
            minute: org.partiql.pig.runtime.LongPrimitive,
            second: org.partiql.pig.runtime.LongPrimitive,
            nano: org.partiql.pig.runtime.LongPrimitive,
            precision: org.partiql.pig.runtime.LongPrimitive,
            withTimeZone: org.partiql.pig.runtime.BoolPrimitive,
            tzMinutes: org.partiql.pig.runtime.LongPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.TimeValue =
            PartiqlAst.TimeValue(
                hour = hour,
                minute = minute,
                second = second,
                nano = nano,
                precision = precision,
                withTimeZone = withTimeZone,
                tzMinutes = tzMinutes,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Let].
         */
        fun let(
            letBindings: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Let =
            PartiqlAst.Let(
                letBindings = letBindings,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Let].
         */
        fun let(
            letBindings0: LetBinding,
            vararg letBindings: LetBinding,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Let =
            PartiqlAst.Let(
                letBindings = listOf(letBindings0) + letBindings.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.LetBinding].
         */
        fun letBinding(
            expr: Expr,
            name: String,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.LetBinding =
            PartiqlAst.LetBinding(
                expr = expr,
                name = name.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.LetBinding].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun letBinding_(
            expr: Expr,
            name: org.partiql.pig.runtime.SymbolPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.LetBinding =
            PartiqlAst.LetBinding(
                expr = expr,
                name = name,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchQuantifier].
         */
        fun graphMatchQuantifier(
            lower: Long,
            upper: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchQuantifier =
            PartiqlAst.GraphMatchQuantifier(
                lower = lower.asPrimitive(),
                upper = upper?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchQuantifier].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun graphMatchQuantifier_(
            lower: org.partiql.pig.runtime.LongPrimitive,
            upper: org.partiql.pig.runtime.LongPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchQuantifier =
            PartiqlAst.GraphMatchQuantifier(
                lower = lower,
                upper = upper,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchPattern].
         */
        fun graphMatchPattern(
            restrictor: GraphMatchRestrictor? = null,
            prefilter: Expr? = null,
            variable: String? = null,
            quantifier: GraphMatchQuantifier? = null,
            parts: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchPattern =
            PartiqlAst.GraphMatchPattern(
                restrictor = restrictor,
                prefilter = prefilter,
                variable = variable?.asPrimitive(),
                quantifier = quantifier,
                parts = parts,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchPattern].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun graphMatchPattern_(
            restrictor: GraphMatchRestrictor? = null,
            prefilter: Expr? = null,
            variable: org.partiql.pig.runtime.SymbolPrimitive? = null,
            quantifier: GraphMatchQuantifier? = null,
            parts: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchPattern =
            PartiqlAst.GraphMatchPattern(
                restrictor = restrictor,
                prefilter = prefilter,
                variable = variable,
                quantifier = quantifier,
                parts = parts,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchPattern].
         */
        fun graphMatchPattern(
            restrictor: GraphMatchRestrictor? = null,
            prefilter: Expr? = null,
            variable: String? = null,
            quantifier: GraphMatchQuantifier? = null,
            parts0: GraphMatchPatternPart,
            vararg parts: GraphMatchPatternPart,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchPattern =
            PartiqlAst.GraphMatchPattern(
                restrictor = restrictor,
                prefilter = prefilter,
                variable = variable?.asPrimitive(),
                quantifier = quantifier,
                parts = listOf(parts0) + parts.toList(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchPattern].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun graphMatchPattern_(
            restrictor: GraphMatchRestrictor? = null,
            prefilter: Expr? = null,
            variable: org.partiql.pig.runtime.SymbolPrimitive? = null,
            quantifier: GraphMatchQuantifier? = null,
            parts0: GraphMatchPatternPart,
            vararg parts: GraphMatchPatternPart,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchPattern =
            PartiqlAst.GraphMatchPattern(
                restrictor = restrictor,
                prefilter = prefilter,
                variable = variable,
                quantifier = quantifier,
                parts = listOf(parts0) + parts.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GpmlPattern].
         */
        fun gpmlPattern(
            selector: GraphMatchSelector? = null,
            patterns: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GpmlPattern =
            PartiqlAst.GpmlPattern(
                selector = selector,
                patterns = patterns,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GpmlPattern].
         */
        fun gpmlPattern(
            selector: GraphMatchSelector? = null,
            patterns0: GraphMatchPattern,
            vararg patterns: GraphMatchPattern,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GpmlPattern =
            PartiqlAst.GpmlPattern(
                selector = selector,
                patterns = listOf(patterns0) + patterns.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.ExprPair].
         */
        fun exprPair(
            first: Expr,
            second: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ExprPair =
            PartiqlAst.ExprPair(
                first = first,
                second = second,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.ExprPairList].
         */
        fun exprPairList(
            pairs: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ExprPairList =
            PartiqlAst.ExprPairList(
                pairs = pairs,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.ExprPairList].
         */
        fun exprPairList(
            vararg pairs: ExprPair,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ExprPairList =
            PartiqlAst.ExprPairList(
                pairs = pairs.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GroupBy].
         */
        fun groupBy(
            strategy: GroupingStrategy,
            keyList: GroupKeyList,
            groupAsAlias: String? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GroupBy =
            PartiqlAst.GroupBy(
                strategy = strategy,
                keyList = keyList,
                groupAsAlias = groupAsAlias?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GroupBy].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun groupBy_(
            strategy: GroupingStrategy,
            keyList: GroupKeyList,
            groupAsAlias: org.partiql.pig.runtime.SymbolPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GroupBy =
            PartiqlAst.GroupBy(
                strategy = strategy,
                keyList = keyList,
                groupAsAlias = groupAsAlias,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GroupKeyList].
         */
        fun groupKeyList(
            keys: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GroupKeyList =
            PartiqlAst.GroupKeyList(
                keys = keys,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GroupKeyList].
         */
        fun groupKeyList(
            keys0: GroupKey,
            vararg keys: GroupKey,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GroupKeyList =
            PartiqlAst.GroupKeyList(
                keys = listOf(keys0) + keys.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GroupKey].
         */
        fun groupKey(
            expr: Expr,
            asAlias: String? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GroupKey =
            PartiqlAst.GroupKey(
                expr = expr,
                asAlias = asAlias?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GroupKey].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun groupKey_(
            expr: Expr,
            asAlias: org.partiql.pig.runtime.SymbolPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GroupKey =
            PartiqlAst.GroupKey(
                expr = expr,
                asAlias = asAlias,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.OrderBy].
         */
        fun orderBy(
            sortSpecs: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.OrderBy =
            PartiqlAst.OrderBy(
                sortSpecs = sortSpecs,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.OrderBy].
         */
        fun orderBy(
            sortSpecs0: SortSpec,
            vararg sortSpecs: SortSpec,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.OrderBy =
            PartiqlAst.OrderBy(
                sortSpecs = listOf(sortSpecs0) + sortSpecs.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.SortSpec].
         */
        fun sortSpec(
            expr: Expr,
            orderingSpec: OrderingSpec? = null,
            nullsSpec: NullsSpec? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.SortSpec =
            PartiqlAst.SortSpec(
                expr = expr,
                orderingSpec = orderingSpec,
                nullsSpec = nullsSpec,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Over].
         */
        fun over(
            partitionBy: WindowPartitionList? = null,
            orderBy: WindowSortSpecList? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Over =
            PartiqlAst.Over(
                partitionBy = partitionBy,
                orderBy = orderBy,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.WindowPartitionList].
         */
        fun windowPartitionList(
            exprs: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.WindowPartitionList =
            PartiqlAst.WindowPartitionList(
                exprs = exprs,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.WindowPartitionList].
         */
        fun windowPartitionList(
            exprs0: Expr,
            vararg exprs: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.WindowPartitionList =
            PartiqlAst.WindowPartitionList(
                exprs = listOf(exprs0) + exprs.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.WindowSortSpecList].
         */
        fun windowSortSpecList(
            sortSpecs: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.WindowSortSpecList =
            PartiqlAst.WindowSortSpecList(
                sortSpecs = sortSpecs,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.WindowSortSpecList].
         */
        fun windowSortSpecList(
            sortSpecs0: SortSpec,
            vararg sortSpecs: SortSpec,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.WindowSortSpecList =
            PartiqlAst.WindowSortSpecList(
                sortSpecs = listOf(sortSpecs0) + sortSpecs.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.DmlOpList].
         */
        fun dmlOpList(
            ops: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.DmlOpList =
            PartiqlAst.DmlOpList(
                ops = ops,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.DmlOpList].
         */
        fun dmlOpList(
            ops0: DmlOp,
            vararg ops: DmlOp,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.DmlOpList =
            PartiqlAst.DmlOpList(
                ops = listOf(ops0) + ops.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.OnConflict].
         */
        fun onConflict(
            expr: Expr,
            conflictAction: ConflictAction,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.OnConflict =
            PartiqlAst.OnConflict(
                expr = expr,
                conflictAction = conflictAction,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.ReturningExpr].
         */
        fun returningExpr(
            elems: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ReturningExpr =
            PartiqlAst.ReturningExpr(
                elems = elems,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.ReturningExpr].
         */
        fun returningExpr(
            elems0: ReturningElem,
            vararg elems: ReturningElem,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ReturningExpr =
            PartiqlAst.ReturningExpr(
                elems = listOf(elems0) + elems.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.ReturningElem].
         */
        fun returningElem(
            mapping: ReturningMapping,
            column: ColumnComponent,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ReturningElem =
            PartiqlAst.ReturningElem(
                mapping = mapping,
                column = column,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Identifier].
         */
        fun identifier(
            name: String,
            case: CaseSensitivity,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Identifier =
            PartiqlAst.Identifier(
                name = name.asPrimitive(),
                case = case,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Identifier].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun identifier_(
            name: org.partiql.pig.runtime.SymbolPrimitive,
            case: CaseSensitivity,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Identifier =
            PartiqlAst.Identifier(
                name = name,
                case = case,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Assignment].
         */
        fun assignment(
            target: Expr,
            value: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Assignment =
            PartiqlAst.Assignment(
                target = target,
                value = value,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: Statement 
        /**
         * Creates an instance of [PartiqlAst.Statement.Query].
         */
        fun query(
            expr: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Statement.Query =
            PartiqlAst.Statement.Query(
                expr = expr,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Statement.Dml].
         */
        fun dml(
            operations: DmlOpList,
            from: FromSource? = null,
            where: Expr? = null,
            returning: ReturningExpr? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Statement.Dml =
            PartiqlAst.Statement.Dml(
                operations = operations,
                from = from,
                where = where,
                returning = returning,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Statement.Ddl].
         */
        fun ddl(
            op: DdlOp,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Statement.Ddl =
            PartiqlAst.Statement.Ddl(
                op = op,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Statement.Exec].
         */
        fun exec(
            procedureName: String,
            args: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Statement.Exec =
            PartiqlAst.Statement.Exec(
                procedureName = procedureName.asPrimitive(),
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Statement.Exec].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun exec_(
            procedureName: org.partiql.pig.runtime.SymbolPrimitive,
            args: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Statement.Exec =
            PartiqlAst.Statement.Exec(
                procedureName = procedureName,
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Statement.Exec].
         */
        fun exec(
            procedureName: String,
            vararg args: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Statement.Exec =
            PartiqlAst.Statement.Exec(
                procedureName = procedureName?.asPrimitive(),
                args = args.toList(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Statement.Exec].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun exec_(
            procedureName: org.partiql.pig.runtime.SymbolPrimitive,
            vararg args: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Statement.Exec =
            PartiqlAst.Statement.Exec(
                procedureName = procedureName,
                args = args.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Statement.Explain].
         */
        fun explain(
            target: ExplainTarget,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Statement.Explain =
            PartiqlAst.Statement.Explain(
                target = target,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: ExplainTarget 
        /**
         * Creates an instance of [PartiqlAst.ExplainTarget.Domain].
         */
        fun domain(
            statement: Statement,
            type: String? = null,
            format: String? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ExplainTarget.Domain =
            PartiqlAst.ExplainTarget.Domain(
                statement = statement,
                type = type?.asPrimitive(),
                format = format?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.ExplainTarget.Domain].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun domain_(
            statement: Statement,
            type: org.partiql.pig.runtime.SymbolPrimitive? = null,
            format: org.partiql.pig.runtime.SymbolPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ExplainTarget.Domain =
            PartiqlAst.ExplainTarget.Domain(
                statement = statement,
                type = type,
                format = format,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: Expr 
        /**
         * Creates an instance of [PartiqlAst.Expr.Missing].
         */
        fun missing(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Missing =
            PartiqlAst.Expr.Missing(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Lit].
         */
        fun lit(
            value: com.amazon.ionelement.api.IonElement,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Lit =
            PartiqlAst.Expr.Lit(
                value = value.asAnyElement(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Id].
         */
        fun id(
            name: String,
            case: CaseSensitivity,
            qualifier: ScopeQualifier,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Id =
            PartiqlAst.Expr.Id(
                name = name.asPrimitive(),
                case = case,
                qualifier = qualifier,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Id].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun id_(
            name: org.partiql.pig.runtime.SymbolPrimitive,
            case: CaseSensitivity,
            qualifier: ScopeQualifier,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Id =
            PartiqlAst.Expr.Id(
                name = name,
                case = case,
                qualifier = qualifier,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Parameter].
         */
        fun parameter(
            index: Long,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Parameter =
            PartiqlAst.Expr.Parameter(
                index = index.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Parameter].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun parameter_(
            index: org.partiql.pig.runtime.LongPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Parameter =
            PartiqlAst.Expr.Parameter(
                index = index,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Not].
         */
        fun not(
            expr: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Not =
            PartiqlAst.Expr.Not(
                expr = expr,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Pos].
         */
        fun pos(
            expr: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Pos =
            PartiqlAst.Expr.Pos(
                expr = expr,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Neg].
         */
        fun neg(
            expr: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Neg =
            PartiqlAst.Expr.Neg(
                expr = expr,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Plus].
         */
        fun plus(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Plus =
            PartiqlAst.Expr.Plus(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Plus].
         */
        fun plus(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Plus =
            PartiqlAst.Expr.Plus(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Minus].
         */
        fun minus(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Minus =
            PartiqlAst.Expr.Minus(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Minus].
         */
        fun minus(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Minus =
            PartiqlAst.Expr.Minus(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Times].
         */
        fun times(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Times =
            PartiqlAst.Expr.Times(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Times].
         */
        fun times(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Times =
            PartiqlAst.Expr.Times(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Divide].
         */
        fun divide(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Divide =
            PartiqlAst.Expr.Divide(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Divide].
         */
        fun divide(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Divide =
            PartiqlAst.Expr.Divide(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Modulo].
         */
        fun modulo(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Modulo =
            PartiqlAst.Expr.Modulo(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Modulo].
         */
        fun modulo(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Modulo =
            PartiqlAst.Expr.Modulo(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Concat].
         */
        fun concat(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Concat =
            PartiqlAst.Expr.Concat(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Concat].
         */
        fun concat(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Concat =
            PartiqlAst.Expr.Concat(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.And].
         */
        fun and(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.And =
            PartiqlAst.Expr.And(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.And].
         */
        fun and(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.And =
            PartiqlAst.Expr.And(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Or].
         */
        fun or(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Or =
            PartiqlAst.Expr.Or(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Or].
         */
        fun or(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Or =
            PartiqlAst.Expr.Or(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Eq].
         */
        fun eq(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Eq =
            PartiqlAst.Expr.Eq(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Eq].
         */
        fun eq(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Eq =
            PartiqlAst.Expr.Eq(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Ne].
         */
        fun ne(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Ne =
            PartiqlAst.Expr.Ne(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Ne].
         */
        fun ne(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Ne =
            PartiqlAst.Expr.Ne(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Gt].
         */
        fun gt(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Gt =
            PartiqlAst.Expr.Gt(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Gt].
         */
        fun gt(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Gt =
            PartiqlAst.Expr.Gt(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Gte].
         */
        fun gte(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Gte =
            PartiqlAst.Expr.Gte(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Gte].
         */
        fun gte(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Gte =
            PartiqlAst.Expr.Gte(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Lt].
         */
        fun lt(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Lt =
            PartiqlAst.Expr.Lt(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Lt].
         */
        fun lt(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Lt =
            PartiqlAst.Expr.Lt(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Lte].
         */
        fun lte(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Lte =
            PartiqlAst.Expr.Lte(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Lte].
         */
        fun lte(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Lte =
            PartiqlAst.Expr.Lte(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Like].
         */
        fun like(
            value: Expr,
            pattern: Expr,
            escape: Expr? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Like =
            PartiqlAst.Expr.Like(
                value = value,
                pattern = pattern,
                escape = escape,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Between].
         */
        fun between(
            value: Expr,
            from: Expr,
            to: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Between =
            PartiqlAst.Expr.Between(
                value = value,
                from = from,
                to = to,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.InCollection].
         */
        fun inCollection(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.InCollection =
            PartiqlAst.Expr.InCollection(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.InCollection].
         */
        fun inCollection(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.InCollection =
            PartiqlAst.Expr.InCollection(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.IsType].
         */
        fun isType(
            value: Expr,
            type: Type,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.IsType =
            PartiqlAst.Expr.IsType(
                value = value,
                type = type,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.SimpleCase].
         */
        fun simpleCase(
            expr: Expr,
            cases: ExprPairList,
            default: Expr? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.SimpleCase =
            PartiqlAst.Expr.SimpleCase(
                expr = expr,
                cases = cases,
                default = default,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.SearchedCase].
         */
        fun searchedCase(
            cases: ExprPairList,
            default: Expr? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.SearchedCase =
            PartiqlAst.Expr.SearchedCase(
                cases = cases,
                default = default,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Struct].
         */
        fun struct(
            fields: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Struct =
            PartiqlAst.Expr.Struct(
                fields = fields,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Struct].
         */
        fun struct(
            vararg fields: ExprPair,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Struct =
            PartiqlAst.Expr.Struct(
                fields = fields.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Bag].
         */
        fun bag(
            values: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Bag =
            PartiqlAst.Expr.Bag(
                values = values,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Bag].
         */
        fun bag(
            vararg values: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Bag =
            PartiqlAst.Expr.Bag(
                values = values.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.List].
         */
        fun list(
            values: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.List =
            PartiqlAst.Expr.List(
                values = values,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.List].
         */
        fun list(
            vararg values: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.List =
            PartiqlAst.Expr.List(
                values = values.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Sexp].
         */
        fun sexp(
            values: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Sexp =
            PartiqlAst.Expr.Sexp(
                values = values,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Sexp].
         */
        fun sexp(
            vararg values: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Sexp =
            PartiqlAst.Expr.Sexp(
                values = values.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Date].
         */
        fun date(
            year: Long,
            month: Long,
            day: Long,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Date =
            PartiqlAst.Expr.Date(
                year = year.asPrimitive(),
                month = month.asPrimitive(),
                day = day.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Date].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun date_(
            year: org.partiql.pig.runtime.LongPrimitive,
            month: org.partiql.pig.runtime.LongPrimitive,
            day: org.partiql.pig.runtime.LongPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Date =
            PartiqlAst.Expr.Date(
                year = year,
                month = month,
                day = day,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.LitTime].
         */
        fun litTime(
            value: TimeValue,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.LitTime =
            PartiqlAst.Expr.LitTime(
                value = value,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.BagOp].
         */
        fun bagOp(
            op: BagOpType,
            quantifier: SetQuantifier,
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.BagOp =
            PartiqlAst.Expr.BagOp(
                op = op,
                quantifier = quantifier,
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.BagOp].
         */
        fun bagOp(
            op: BagOpType,
            quantifier: SetQuantifier,
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.BagOp =
            PartiqlAst.Expr.BagOp(
                op = op,
                quantifier = quantifier,
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.GraphMatch].
         */
        fun graphMatch(
            expr: Expr,
            gpmlPattern: GpmlPattern,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.GraphMatch =
            PartiqlAst.Expr.GraphMatch(
                expr = expr,
                gpmlPattern = gpmlPattern,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Path].
         */
        fun path(
            root: Expr,
            steps: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Path =
            PartiqlAst.Expr.Path(
                root = root,
                steps = steps,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Path].
         */
        fun path(
            root: Expr,
            steps0: PathStep,
            vararg steps: PathStep,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Path =
            PartiqlAst.Expr.Path(
                root = root,
                steps = listOf(steps0) + steps.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Call].
         */
        fun call(
            funcName: String,
            args: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Call =
            PartiqlAst.Expr.Call(
                funcName = funcName.asPrimitive(),
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Call].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun call_(
            funcName: org.partiql.pig.runtime.SymbolPrimitive,
            args: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Call =
            PartiqlAst.Expr.Call(
                funcName = funcName,
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Call].
         */
        fun call(
            funcName: String,
            args0: Expr,
            vararg args: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Call =
            PartiqlAst.Expr.Call(
                funcName = funcName?.asPrimitive(),
                args = listOf(args0) + args.toList(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Call].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun call_(
            funcName: org.partiql.pig.runtime.SymbolPrimitive,
            args0: Expr,
            vararg args: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Call =
            PartiqlAst.Expr.Call(
                funcName = funcName,
                args = listOf(args0) + args.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.CallAgg].
         */
        fun callAgg(
            setq: SetQuantifier,
            funcName: String,
            arg: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.CallAgg =
            PartiqlAst.Expr.CallAgg(
                setq = setq,
                funcName = funcName.asPrimitive(),
                arg = arg,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.CallAgg].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun callAgg_(
            setq: SetQuantifier,
            funcName: org.partiql.pig.runtime.SymbolPrimitive,
            arg: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.CallAgg =
            PartiqlAst.Expr.CallAgg(
                setq = setq,
                funcName = funcName,
                arg = arg,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.CallWindow].
         */
        fun callWindow(
            funcName: String,
            over: Over,
            args: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.CallWindow =
            PartiqlAst.Expr.CallWindow(
                funcName = funcName.asPrimitive(),
                over = over,
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.CallWindow].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun callWindow_(
            funcName: org.partiql.pig.runtime.SymbolPrimitive,
            over: Over,
            args: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.CallWindow =
            PartiqlAst.Expr.CallWindow(
                funcName = funcName,
                over = over,
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.CallWindow].
         */
        fun callWindow(
            funcName: String,
            over: Over,
            args0: Expr,
            vararg args: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.CallWindow =
            PartiqlAst.Expr.CallWindow(
                funcName = funcName?.asPrimitive(),
                over = over,
                args = listOf(args0) + args.toList(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.CallWindow].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun callWindow_(
            funcName: org.partiql.pig.runtime.SymbolPrimitive,
            over: Over,
            args0: Expr,
            vararg args: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.CallWindow =
            PartiqlAst.Expr.CallWindow(
                funcName = funcName,
                over = over,
                args = listOf(args0) + args.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Cast].
         */
        fun cast(
            value: Expr,
            asType: Type,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Cast =
            PartiqlAst.Expr.Cast(
                value = value,
                asType = asType,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.CanCast].
         */
        fun canCast(
            value: Expr,
            asType: Type,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.CanCast =
            PartiqlAst.Expr.CanCast(
                value = value,
                asType = asType,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.CanLosslessCast].
         */
        fun canLosslessCast(
            value: Expr,
            asType: Type,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.CanLosslessCast =
            PartiqlAst.Expr.CanLosslessCast(
                value = value,
                asType = asType,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.NullIf].
         */
        fun nullIf(
            expr1: Expr,
            expr2: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.NullIf =
            PartiqlAst.Expr.NullIf(
                expr1 = expr1,
                expr2 = expr2,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Coalesce].
         */
        fun coalesce(
            args: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Coalesce =
            PartiqlAst.Expr.Coalesce(
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Coalesce].
         */
        fun coalesce(
            args0: Expr,
            vararg args: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Coalesce =
            PartiqlAst.Expr.Coalesce(
                args = listOf(args0) + args.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Expr.Select].
         */
        fun select(
            setq: SetQuantifier? = null,
            project: Projection,
            from: FromSource,
            fromLet: Let? = null,
            where: Expr? = null,
            group: GroupBy? = null,
            having: Expr? = null,
            order: OrderBy? = null,
            limit: Expr? = null,
            offset: Expr? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Expr.Select =
            PartiqlAst.Expr.Select(
                setq = setq,
                project = project,
                from = from,
                fromLet = fromLet,
                where = where,
                group = group,
                having = having,
                order = order,
                limit = limit,
                offset = offset,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: PathStep 
        /**
         * Creates an instance of [PartiqlAst.PathStep.PathExpr].
         */
        fun pathExpr(
            index: Expr,
            case: CaseSensitivity,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.PathStep.PathExpr =
            PartiqlAst.PathStep.PathExpr(
                index = index,
                case = case,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.PathStep.PathWildcard].
         */
        fun pathWildcard(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.PathStep.PathWildcard =
            PartiqlAst.PathStep.PathWildcard(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.PathStep.PathUnpivot].
         */
        fun pathUnpivot(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.PathStep.PathUnpivot =
            PartiqlAst.PathStep.PathUnpivot(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: Projection 
        /**
         * Creates an instance of [PartiqlAst.Projection.ProjectStar].
         */
        fun projectStar(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Projection.ProjectStar =
            PartiqlAst.Projection.ProjectStar(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Projection.ProjectList].
         */
        fun projectList(
            projectItems: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Projection.ProjectList =
            PartiqlAst.Projection.ProjectList(
                projectItems = projectItems,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Projection.ProjectList].
         */
        fun projectList(
            projectItems0: ProjectItem,
            vararg projectItems: ProjectItem,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Projection.ProjectList =
            PartiqlAst.Projection.ProjectList(
                projectItems = listOf(projectItems0) + projectItems.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Projection.ProjectPivot].
         */
        fun projectPivot(
            value: Expr,
            key: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Projection.ProjectPivot =
            PartiqlAst.Projection.ProjectPivot(
                value = value,
                key = key,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Projection.ProjectValue].
         */
        fun projectValue(
            value: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Projection.ProjectValue =
            PartiqlAst.Projection.ProjectValue(
                value = value,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: ProjectItem 
        /**
         * Creates an instance of [PartiqlAst.ProjectItem.ProjectAll].
         */
        fun projectAll(
            expr: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ProjectItem.ProjectAll =
            PartiqlAst.ProjectItem.ProjectAll(
                expr = expr,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.ProjectItem.ProjectExpr].
         */
        fun projectExpr(
            expr: Expr,
            asAlias: String? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ProjectItem.ProjectExpr =
            PartiqlAst.ProjectItem.ProjectExpr(
                expr = expr,
                asAlias = asAlias?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.ProjectItem.ProjectExpr].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun projectExpr_(
            expr: Expr,
            asAlias: org.partiql.pig.runtime.SymbolPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ProjectItem.ProjectExpr =
            PartiqlAst.ProjectItem.ProjectExpr(
                expr = expr,
                asAlias = asAlias,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: FromSource 
        /**
         * Creates an instance of [PartiqlAst.FromSource.Scan].
         */
        fun scan(
            expr: Expr,
            asAlias: String? = null,
            atAlias: String? = null,
            byAlias: String? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.FromSource.Scan =
            PartiqlAst.FromSource.Scan(
                expr = expr,
                asAlias = asAlias?.asPrimitive(),
                atAlias = atAlias?.asPrimitive(),
                byAlias = byAlias?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.FromSource.Scan].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun scan_(
            expr: Expr,
            asAlias: org.partiql.pig.runtime.SymbolPrimitive? = null,
            atAlias: org.partiql.pig.runtime.SymbolPrimitive? = null,
            byAlias: org.partiql.pig.runtime.SymbolPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.FromSource.Scan =
            PartiqlAst.FromSource.Scan(
                expr = expr,
                asAlias = asAlias,
                atAlias = atAlias,
                byAlias = byAlias,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.FromSource.Unpivot].
         */
        fun unpivot(
            expr: Expr,
            asAlias: String? = null,
            atAlias: String? = null,
            byAlias: String? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.FromSource.Unpivot =
            PartiqlAst.FromSource.Unpivot(
                expr = expr,
                asAlias = asAlias?.asPrimitive(),
                atAlias = atAlias?.asPrimitive(),
                byAlias = byAlias?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.FromSource.Unpivot].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun unpivot_(
            expr: Expr,
            asAlias: org.partiql.pig.runtime.SymbolPrimitive? = null,
            atAlias: org.partiql.pig.runtime.SymbolPrimitive? = null,
            byAlias: org.partiql.pig.runtime.SymbolPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.FromSource.Unpivot =
            PartiqlAst.FromSource.Unpivot(
                expr = expr,
                asAlias = asAlias,
                atAlias = atAlias,
                byAlias = byAlias,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.FromSource.Join].
         */
        fun join(
            type: JoinType,
            left: FromSource,
            right: FromSource,
            predicate: Expr? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.FromSource.Join =
            PartiqlAst.FromSource.Join(
                type = type,
                left = left,
                right = right,
                predicate = predicate,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: JoinType 
        /**
         * Creates an instance of [PartiqlAst.JoinType.Inner].
         */
        fun inner(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.JoinType.Inner =
            PartiqlAst.JoinType.Inner(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.JoinType.Left].
         */
        fun left(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.JoinType.Left =
            PartiqlAst.JoinType.Left(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.JoinType.Right].
         */
        fun right(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.JoinType.Right =
            PartiqlAst.JoinType.Right(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.JoinType.Full].
         */
        fun full(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.JoinType.Full =
            PartiqlAst.JoinType.Full(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: GraphMatchDirection 
        /**
         * Creates an instance of [PartiqlAst.GraphMatchDirection.EdgeLeft].
         */
        fun edgeLeft(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchDirection.EdgeLeft =
            PartiqlAst.GraphMatchDirection.EdgeLeft(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchDirection.EdgeUndirected].
         */
        fun edgeUndirected(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchDirection.EdgeUndirected =
            PartiqlAst.GraphMatchDirection.EdgeUndirected(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchDirection.EdgeRight].
         */
        fun edgeRight(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchDirection.EdgeRight =
            PartiqlAst.GraphMatchDirection.EdgeRight(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected].
         */
        fun edgeLeftOrUndirected(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected =
            PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight].
         */
        fun edgeUndirectedOrRight(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight =
            PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchDirection.EdgeLeftOrRight].
         */
        fun edgeLeftOrRight(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchDirection.EdgeLeftOrRight =
            PartiqlAst.GraphMatchDirection.EdgeLeftOrRight(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight].
         */
        fun edgeLeftOrUndirectedOrRight(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight =
            PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: GraphMatchPatternPart 
        /**
         * Creates an instance of [PartiqlAst.GraphMatchPatternPart.Node].
         */
        fun node(
            prefilter: Expr? = null,
            variable: String? = null,
            label: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchPatternPart.Node =
            PartiqlAst.GraphMatchPatternPart.Node(
                prefilter = prefilter,
                variable = variable?.asPrimitive(),
                label = label.map { it.asPrimitive() },
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchPatternPart.Node].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun node_(
            prefilter: Expr? = null,
            variable: org.partiql.pig.runtime.SymbolPrimitive? = null,
            label: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchPatternPart.Node =
            PartiqlAst.GraphMatchPatternPart.Node(
                prefilter = prefilter,
                variable = variable,
                label = label,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchPatternPart.Node].
         */
        fun node(
            prefilter: Expr? = null,
            variable: String? = null,
            vararg label: String,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchPatternPart.Node =
            PartiqlAst.GraphMatchPatternPart.Node(
                prefilter = prefilter,
                variable = variable?.asPrimitive(),
                label = label.map { it.asPrimitive() },
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchPatternPart.Node].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun node_(
            prefilter: Expr? = null,
            variable: org.partiql.pig.runtime.SymbolPrimitive? = null,
            vararg label: org.partiql.pig.runtime.SymbolPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchPatternPart.Node =
            PartiqlAst.GraphMatchPatternPart.Node(
                prefilter = prefilter,
                variable = variable,
                label = label.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchPatternPart.Edge].
         */
        fun edge(
            direction: GraphMatchDirection,
            quantifier: GraphMatchQuantifier? = null,
            prefilter: Expr? = null,
            variable: String? = null,
            label: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchPatternPart.Edge =
            PartiqlAst.GraphMatchPatternPart.Edge(
                direction = direction,
                quantifier = quantifier,
                prefilter = prefilter,
                variable = variable?.asPrimitive(),
                label = label.map { it.asPrimitive() },
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchPatternPart.Edge].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun edge_(
            direction: GraphMatchDirection,
            quantifier: GraphMatchQuantifier? = null,
            prefilter: Expr? = null,
            variable: org.partiql.pig.runtime.SymbolPrimitive? = null,
            label: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchPatternPart.Edge =
            PartiqlAst.GraphMatchPatternPart.Edge(
                direction = direction,
                quantifier = quantifier,
                prefilter = prefilter,
                variable = variable,
                label = label,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchPatternPart.Edge].
         */
        fun edge(
            direction: GraphMatchDirection,
            quantifier: GraphMatchQuantifier? = null,
            prefilter: Expr? = null,
            variable: String? = null,
            vararg label: String,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchPatternPart.Edge =
            PartiqlAst.GraphMatchPatternPart.Edge(
                direction = direction,
                quantifier = quantifier,
                prefilter = prefilter,
                variable = variable?.asPrimitive(),
                label = label.map { it.asPrimitive() },
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchPatternPart.Edge].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun edge_(
            direction: GraphMatchDirection,
            quantifier: GraphMatchQuantifier? = null,
            prefilter: Expr? = null,
            variable: org.partiql.pig.runtime.SymbolPrimitive? = null,
            vararg label: org.partiql.pig.runtime.SymbolPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchPatternPart.Edge =
            PartiqlAst.GraphMatchPatternPart.Edge(
                direction = direction,
                quantifier = quantifier,
                prefilter = prefilter,
                variable = variable,
                label = label.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchPatternPart.Pattern].
         */
        fun pattern(
            pattern: GraphMatchPattern,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchPatternPart.Pattern =
            PartiqlAst.GraphMatchPatternPart.Pattern(
                pattern = pattern,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: GraphMatchRestrictor 
        /**
         * Creates an instance of [PartiqlAst.GraphMatchRestrictor.RestrictorTrail].
         */
        fun restrictorTrail(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchRestrictor.RestrictorTrail =
            PartiqlAst.GraphMatchRestrictor.RestrictorTrail(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic].
         */
        fun restrictorAcyclic(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic =
            PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchRestrictor.RestrictorSimple].
         */
        fun restrictorSimple(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchRestrictor.RestrictorSimple =
            PartiqlAst.GraphMatchRestrictor.RestrictorSimple(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: GraphMatchSelector 
        /**
         * Creates an instance of [PartiqlAst.GraphMatchSelector.SelectorAnyShortest].
         */
        fun selectorAnyShortest(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchSelector.SelectorAnyShortest =
            PartiqlAst.GraphMatchSelector.SelectorAnyShortest(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchSelector.SelectorAllShortest].
         */
        fun selectorAllShortest(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchSelector.SelectorAllShortest =
            PartiqlAst.GraphMatchSelector.SelectorAllShortest(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchSelector.SelectorAny].
         */
        fun selectorAny(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchSelector.SelectorAny =
            PartiqlAst.GraphMatchSelector.SelectorAny(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchSelector.SelectorAnyK].
         */
        fun selectorAnyK(
            k: Long,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchSelector.SelectorAnyK =
            PartiqlAst.GraphMatchSelector.SelectorAnyK(
                k = k.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchSelector.SelectorAnyK].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun selectorAnyK_(
            k: org.partiql.pig.runtime.LongPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchSelector.SelectorAnyK =
            PartiqlAst.GraphMatchSelector.SelectorAnyK(
                k = k,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchSelector.SelectorShortestK].
         */
        fun selectorShortestK(
            k: Long,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchSelector.SelectorShortestK =
            PartiqlAst.GraphMatchSelector.SelectorShortestK(
                k = k.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchSelector.SelectorShortestK].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun selectorShortestK_(
            k: org.partiql.pig.runtime.LongPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchSelector.SelectorShortestK =
            PartiqlAst.GraphMatchSelector.SelectorShortestK(
                k = k,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchSelector.SelectorShortestKGroup].
         */
        fun selectorShortestKGroup(
            k: Long,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchSelector.SelectorShortestKGroup =
            PartiqlAst.GraphMatchSelector.SelectorShortestKGroup(
                k = k.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.GraphMatchSelector.SelectorShortestKGroup].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun selectorShortestKGroup_(
            k: org.partiql.pig.runtime.LongPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GraphMatchSelector.SelectorShortestKGroup =
            PartiqlAst.GraphMatchSelector.SelectorShortestKGroup(
                k = k,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: GroupingStrategy 
        /**
         * Creates an instance of [PartiqlAst.GroupingStrategy.GroupFull].
         */
        fun groupFull(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GroupingStrategy.GroupFull =
            PartiqlAst.GroupingStrategy.GroupFull(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.GroupingStrategy.GroupPartial].
         */
        fun groupPartial(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.GroupingStrategy.GroupPartial =
            PartiqlAst.GroupingStrategy.GroupPartial(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: OrderingSpec 
        /**
         * Creates an instance of [PartiqlAst.OrderingSpec.Asc].
         */
        fun asc(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.OrderingSpec.Asc =
            PartiqlAst.OrderingSpec.Asc(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.OrderingSpec.Desc].
         */
        fun desc(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.OrderingSpec.Desc =
            PartiqlAst.OrderingSpec.Desc(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: NullsSpec 
        /**
         * Creates an instance of [PartiqlAst.NullsSpec.NullsFirst].
         */
        fun nullsFirst(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.NullsSpec.NullsFirst =
            PartiqlAst.NullsSpec.NullsFirst(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.NullsSpec.NullsLast].
         */
        fun nullsLast(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.NullsSpec.NullsLast =
            PartiqlAst.NullsSpec.NullsLast(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: CaseSensitivity 
        /**
         * Creates an instance of [PartiqlAst.CaseSensitivity.CaseSensitive].
         */
        fun caseSensitive(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.CaseSensitivity.CaseSensitive =
            PartiqlAst.CaseSensitivity.CaseSensitive(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.CaseSensitivity.CaseInsensitive].
         */
        fun caseInsensitive(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.CaseSensitivity.CaseInsensitive =
            PartiqlAst.CaseSensitivity.CaseInsensitive(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: ScopeQualifier 
        /**
         * Creates an instance of [PartiqlAst.ScopeQualifier.Unqualified].
         */
        fun unqualified(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ScopeQualifier.Unqualified =
            PartiqlAst.ScopeQualifier.Unqualified(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.ScopeQualifier.LocalsFirst].
         */
        fun localsFirst(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ScopeQualifier.LocalsFirst =
            PartiqlAst.ScopeQualifier.LocalsFirst(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: SetQuantifier 
        /**
         * Creates an instance of [PartiqlAst.SetQuantifier.All].
         */
        fun all(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.SetQuantifier.All =
            PartiqlAst.SetQuantifier.All(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.SetQuantifier.Distinct].
         */
        fun distinct(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.SetQuantifier.Distinct =
            PartiqlAst.SetQuantifier.Distinct(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: BagOpType 
        /**
         * Creates an instance of [PartiqlAst.BagOpType.Union].
         */
        fun union(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.BagOpType.Union =
            PartiqlAst.BagOpType.Union(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.BagOpType.Intersect].
         */
        fun intersect(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.BagOpType.Intersect =
            PartiqlAst.BagOpType.Intersect(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.BagOpType.Except].
         */
        fun except(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.BagOpType.Except =
            PartiqlAst.BagOpType.Except(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.BagOpType.OuterUnion].
         */
        fun outerUnion(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.BagOpType.OuterUnion =
            PartiqlAst.BagOpType.OuterUnion(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.BagOpType.OuterIntersect].
         */
        fun outerIntersect(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.BagOpType.OuterIntersect =
            PartiqlAst.BagOpType.OuterIntersect(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.BagOpType.OuterExcept].
         */
        fun outerExcept(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.BagOpType.OuterExcept =
            PartiqlAst.BagOpType.OuterExcept(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: DmlOp 
        /**
         * Creates an instance of [PartiqlAst.DmlOp.Insert].
         */
        fun insert(
            target: Expr,
            values: Expr,
            conflictAction: ConflictAction? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.DmlOp.Insert =
            PartiqlAst.DmlOp.Insert(
                target = target,
                values = values,
                conflictAction = conflictAction,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.DmlOp.InsertValue].
         */
        fun insertValue(
            target: Expr,
            value: Expr,
            index: Expr? = null,
            onConflict: OnConflict? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.DmlOp.InsertValue =
            PartiqlAst.DmlOp.InsertValue(
                target = target,
                value = value,
                index = index,
                onConflict = onConflict,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.DmlOp.Set].
         */
        fun set(
            assignment: Assignment,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.DmlOp.Set =
            PartiqlAst.DmlOp.Set(
                assignment = assignment,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.DmlOp.Remove].
         */
        fun remove(
            target: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.DmlOp.Remove =
            PartiqlAst.DmlOp.Remove(
                target = target,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.DmlOp.Delete].
         */
        fun delete(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.DmlOp.Delete =
            PartiqlAst.DmlOp.Delete(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: ConflictAction 
        /**
         * Creates an instance of [PartiqlAst.ConflictAction.DoReplace].
         */
        fun doReplace(
            value: OnConflictValue,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ConflictAction.DoReplace =
            PartiqlAst.ConflictAction.DoReplace(
                value = value,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.ConflictAction.DoUpdate].
         */
        fun doUpdate(
            value: OnConflictValue,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ConflictAction.DoUpdate =
            PartiqlAst.ConflictAction.DoUpdate(
                value = value,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.ConflictAction.DoNothing].
         */
        fun doNothing(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ConflictAction.DoNothing =
            PartiqlAst.ConflictAction.DoNothing(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: OnConflictValue 
        /**
         * Creates an instance of [PartiqlAst.OnConflictValue.Excluded].
         */
        fun excluded(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.OnConflictValue.Excluded =
            PartiqlAst.OnConflictValue.Excluded(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: DdlOp 
        /**
         * Creates an instance of [PartiqlAst.DdlOp.CreateTable].
         */
        fun createTable(
            tableName: String,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.DdlOp.CreateTable =
            PartiqlAst.DdlOp.CreateTable(
                tableName = tableName.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.DdlOp.CreateTable].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun createTable_(
            tableName: org.partiql.pig.runtime.SymbolPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.DdlOp.CreateTable =
            PartiqlAst.DdlOp.CreateTable(
                tableName = tableName,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.DdlOp.DropTable].
         */
        fun dropTable(
            tableName: Identifier,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.DdlOp.DropTable =
            PartiqlAst.DdlOp.DropTable(
                tableName = tableName,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.DdlOp.CreateIndex].
         */
        fun createIndex(
            indexName: Identifier,
            fields: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.DdlOp.CreateIndex =
            PartiqlAst.DdlOp.CreateIndex(
                indexName = indexName,
                fields = fields,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.DdlOp.CreateIndex].
         */
        fun createIndex(
            indexName: Identifier,
            fields0: Expr,
            vararg fields: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.DdlOp.CreateIndex =
            PartiqlAst.DdlOp.CreateIndex(
                indexName = indexName,
                fields = listOf(fields0) + fields.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.DdlOp.DropIndex].
         */
        fun dropIndex(
            table: Identifier,
            keys: Identifier,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.DdlOp.DropIndex =
            PartiqlAst.DdlOp.DropIndex(
                table = table,
                keys = keys,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: ColumnComponent 
        /**
         * Creates an instance of [PartiqlAst.ColumnComponent.ReturningWildcard].
         */
        fun returningWildcard(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ColumnComponent.ReturningWildcard =
            PartiqlAst.ColumnComponent.ReturningWildcard(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.ColumnComponent.ReturningColumn].
         */
        fun returningColumn(
            expr: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ColumnComponent.ReturningColumn =
            PartiqlAst.ColumnComponent.ReturningColumn(
                expr = expr,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: ReturningMapping 
        /**
         * Creates an instance of [PartiqlAst.ReturningMapping.ModifiedNew].
         */
        fun modifiedNew(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ReturningMapping.ModifiedNew =
            PartiqlAst.ReturningMapping.ModifiedNew(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.ReturningMapping.ModifiedOld].
         */
        fun modifiedOld(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ReturningMapping.ModifiedOld =
            PartiqlAst.ReturningMapping.ModifiedOld(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.ReturningMapping.AllNew].
         */
        fun allNew(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ReturningMapping.AllNew =
            PartiqlAst.ReturningMapping.AllNew(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.ReturningMapping.AllOld].
         */
        fun allOld(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.ReturningMapping.AllOld =
            PartiqlAst.ReturningMapping.AllOld(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: Type 
        /**
         * Creates an instance of [PartiqlAst.Type.NullType].
         */
        fun nullType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.NullType =
            PartiqlAst.Type.NullType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.BooleanType].
         */
        fun booleanType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.BooleanType =
            PartiqlAst.Type.BooleanType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.SmallintType].
         */
        fun smallintType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.SmallintType =
            PartiqlAst.Type.SmallintType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.Integer4Type].
         */
        fun integer4Type(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.Integer4Type =
            PartiqlAst.Type.Integer4Type(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.Integer8Type].
         */
        fun integer8Type(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.Integer8Type =
            PartiqlAst.Type.Integer8Type(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.IntegerType].
         */
        fun integerType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.IntegerType =
            PartiqlAst.Type.IntegerType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.FloatType].
         */
        fun floatType(
            precision: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.FloatType =
            PartiqlAst.Type.FloatType(
                precision = precision?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Type.FloatType].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun floatType_(
            precision: org.partiql.pig.runtime.LongPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.FloatType =
            PartiqlAst.Type.FloatType(
                precision = precision,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.RealType].
         */
        fun realType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.RealType =
            PartiqlAst.Type.RealType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.DoublePrecisionType].
         */
        fun doublePrecisionType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.DoublePrecisionType =
            PartiqlAst.Type.DoublePrecisionType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.DecimalType].
         */
        fun decimalType(
            precision: Long? = null,
            scale: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.DecimalType =
            PartiqlAst.Type.DecimalType(
                precision = precision?.asPrimitive(),
                scale = scale?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Type.DecimalType].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun decimalType_(
            precision: org.partiql.pig.runtime.LongPrimitive? = null,
            scale: org.partiql.pig.runtime.LongPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.DecimalType =
            PartiqlAst.Type.DecimalType(
                precision = precision,
                scale = scale,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.NumericType].
         */
        fun numericType(
            precision: Long? = null,
            scale: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.NumericType =
            PartiqlAst.Type.NumericType(
                precision = precision?.asPrimitive(),
                scale = scale?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Type.NumericType].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun numericType_(
            precision: org.partiql.pig.runtime.LongPrimitive? = null,
            scale: org.partiql.pig.runtime.LongPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.NumericType =
            PartiqlAst.Type.NumericType(
                precision = precision,
                scale = scale,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.TimestampType].
         */
        fun timestampType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.TimestampType =
            PartiqlAst.Type.TimestampType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.CharacterType].
         */
        fun characterType(
            length: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.CharacterType =
            PartiqlAst.Type.CharacterType(
                length = length?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Type.CharacterType].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun characterType_(
            length: org.partiql.pig.runtime.LongPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.CharacterType =
            PartiqlAst.Type.CharacterType(
                length = length,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.CharacterVaryingType].
         */
        fun characterVaryingType(
            length: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.CharacterVaryingType =
            PartiqlAst.Type.CharacterVaryingType(
                length = length?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Type.CharacterVaryingType].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun characterVaryingType_(
            length: org.partiql.pig.runtime.LongPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.CharacterVaryingType =
            PartiqlAst.Type.CharacterVaryingType(
                length = length,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.MissingType].
         */
        fun missingType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.MissingType =
            PartiqlAst.Type.MissingType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.StringType].
         */
        fun stringType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.StringType =
            PartiqlAst.Type.StringType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.SymbolType].
         */
        fun symbolType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.SymbolType =
            PartiqlAst.Type.SymbolType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.BlobType].
         */
        fun blobType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.BlobType =
            PartiqlAst.Type.BlobType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.ClobType].
         */
        fun clobType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.ClobType =
            PartiqlAst.Type.ClobType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.DateType].
         */
        fun dateType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.DateType =
            PartiqlAst.Type.DateType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.TimeType].
         */
        fun timeType(
            precision: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.TimeType =
            PartiqlAst.Type.TimeType(
                precision = precision?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Type.TimeType].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun timeType_(
            precision: org.partiql.pig.runtime.LongPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.TimeType =
            PartiqlAst.Type.TimeType(
                precision = precision,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.TimeWithTimeZoneType].
         */
        fun timeWithTimeZoneType(
            precision: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.TimeWithTimeZoneType =
            PartiqlAst.Type.TimeWithTimeZoneType(
                precision = precision?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Type.TimeWithTimeZoneType].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun timeWithTimeZoneType_(
            precision: org.partiql.pig.runtime.LongPrimitive? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.TimeWithTimeZoneType =
            PartiqlAst.Type.TimeWithTimeZoneType(
                precision = precision,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.StructType].
         */
        fun structType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.StructType =
            PartiqlAst.Type.StructType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.TupleType].
         */
        fun tupleType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.TupleType =
            PartiqlAst.Type.TupleType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.ListType].
         */
        fun listType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.ListType =
            PartiqlAst.Type.ListType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.SexpType].
         */
        fun sexpType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.SexpType =
            PartiqlAst.Type.SexpType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.BagType].
         */
        fun bagType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.BagType =
            PartiqlAst.Type.BagType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.AnyType].
         */
        fun anyType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.AnyType =
            PartiqlAst.Type.AnyType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlAst.Type.CustomType].
         */
        fun customType(
            name: String,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.CustomType =
            PartiqlAst.Type.CustomType(
                name = name.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlAst.Type.CustomType].
         *
         * Use this variant when metas must be passed to primitive child elements.
         *
         * (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
         */
        fun customType_(
            name: org.partiql.pig.runtime.SymbolPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlAst.Type.CustomType =
            PartiqlAst.Type.CustomType(
                name = name,
                metas = newMetaContainer() + metas
            )
    }
    
    /** Default implementation of [Builder] that uses all default method implementations. */
    private object PartiqlAstBuilder : Builder
    
    /** Base class for all PartiqlAst types. */
    abstract class PartiqlAstNode : DomainNode {
        abstract override fun copy(metas: MetaContainer): PartiqlAstNode
        override fun toString() = toIonElement().toString()
        abstract override fun withMeta(metaKey: String, metaValue: Any): PartiqlAstNode
        abstract override fun toIonElement(): SexpElement
    }
    
    
    /////////////////////////////////////////////////////////////////////////////
    // Tuple Types
    /////////////////////////////////////////////////////////////////////////////
    class TimeValue(
        val hour: org.partiql.pig.runtime.LongPrimitive,
        val minute: org.partiql.pig.runtime.LongPrimitive,
        val second: org.partiql.pig.runtime.LongPrimitive,
        val nano: org.partiql.pig.runtime.LongPrimitive,
        val precision: org.partiql.pig.runtime.LongPrimitive,
        val withTimeZone: org.partiql.pig.runtime.BoolPrimitive,
        val tzMinutes: org.partiql.pig.runtime.LongPrimitive?,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): TimeValue =
            TimeValue(
                hour = hour,
                minute = minute,
                second = second,
                nano = nano,
                precision = precision,
                withTimeZone = withTimeZone,
                tzMinutes = tzMinutes,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): TimeValue =
            TimeValue(
                hour = hour,
                minute = minute,
                second = second,
                nano = nano,
                precision = precision,
                withTimeZone = withTimeZone,
                tzMinutes = tzMinutes,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("time_value"),
                hour.toIonElement(),
                minute.toIonElement(),
                second.toIonElement(),
                nano.toIonElement(),
                precision.toIonElement(),
                withTimeZone.toIonElement(),
                tzMinutes?.toIonElement() ?: ionNull(),
                metas = metas)
            return elements
        }
    
        fun copy(
            hour: org.partiql.pig.runtime.LongPrimitive = this.hour,
            minute: org.partiql.pig.runtime.LongPrimitive = this.minute,
            second: org.partiql.pig.runtime.LongPrimitive = this.second,
            nano: org.partiql.pig.runtime.LongPrimitive = this.nano,
            precision: org.partiql.pig.runtime.LongPrimitive = this.precision,
            withTimeZone: org.partiql.pig.runtime.BoolPrimitive = this.withTimeZone,
            tzMinutes: org.partiql.pig.runtime.LongPrimitive? = this.tzMinutes,
            metas: MetaContainer = this.metas
        ) =
            TimeValue(
                hour,
                minute,
                second,
                nano,
                precision,
                withTimeZone,
                tzMinutes,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != TimeValue::class.java) return false
    
            other as TimeValue
            if (hour != other.hour) return false
            if (minute != other.minute) return false
            if (second != other.second) return false
            if (nano != other.nano) return false
            if (precision != other.precision) return false
            if (withTimeZone != other.withTimeZone) return false
            if (tzMinutes != other.tzMinutes) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = hour.hashCode()
            hc = 31 * hc + minute.hashCode()
            hc = 31 * hc + second.hashCode()
            hc = 31 * hc + nano.hashCode()
            hc = 31 * hc + precision.hashCode()
            hc = 31 * hc + withTimeZone.hashCode()
            hc = 31 * hc + tzMinutes.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class Let(
        val letBindings: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): Let =
            Let(
                letBindings = letBindings,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): Let =
            Let(
                letBindings = letBindings,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("let"),
                *letBindings.map { it.toIonElement() }.toTypedArray(),
                metas = metas)
            return elements
        }
    
        fun copy(
            letBindings: kotlin.collections.List = this.letBindings,
            metas: MetaContainer = this.metas
        ) =
            Let(
                letBindings,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != Let::class.java) return false
    
            other as Let
            if (letBindings != other.letBindings) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = letBindings.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class LetBinding(
        val expr: Expr,
        val name: org.partiql.pig.runtime.SymbolPrimitive,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): LetBinding =
            LetBinding(
                expr = expr,
                name = name,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): LetBinding =
            LetBinding(
                expr = expr,
                name = name,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("let_binding"),
                expr.toIonElement(),
                name.toIonElement(),
                metas = metas)
            return elements
        }
    
        fun copy(
            expr: Expr = this.expr,
            name: org.partiql.pig.runtime.SymbolPrimitive = this.name,
            metas: MetaContainer = this.metas
        ) =
            LetBinding(
                expr,
                name,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != LetBinding::class.java) return false
    
            other as LetBinding
            if (expr != other.expr) return false
            if (name != other.name) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = expr.hashCode()
            hc = 31 * hc + name.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class GraphMatchQuantifier(
        val lower: org.partiql.pig.runtime.LongPrimitive,
        val upper: org.partiql.pig.runtime.LongPrimitive?,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): GraphMatchQuantifier =
            GraphMatchQuantifier(
                lower = lower,
                upper = upper,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): GraphMatchQuantifier =
            GraphMatchQuantifier(
                lower = lower,
                upper = upper,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("graph_match_quantifier"),
                lower.toIonElement(),
                upper?.toIonElement() ?: ionNull(),
                metas = metas)
            return elements
        }
    
        fun copy(
            lower: org.partiql.pig.runtime.LongPrimitive = this.lower,
            upper: org.partiql.pig.runtime.LongPrimitive? = this.upper,
            metas: MetaContainer = this.metas
        ) =
            GraphMatchQuantifier(
                lower,
                upper,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != GraphMatchQuantifier::class.java) return false
    
            other as GraphMatchQuantifier
            if (lower != other.lower) return false
            if (upper != other.upper) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = lower.hashCode()
            hc = 31 * hc + upper.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class GraphMatchPattern(
        val restrictor: GraphMatchRestrictor?,
        val prefilter: Expr?,
        val variable: org.partiql.pig.runtime.SymbolPrimitive?,
        val quantifier: GraphMatchQuantifier?,
        val parts: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): GraphMatchPattern =
            GraphMatchPattern(
                restrictor = restrictor,
                prefilter = prefilter,
                variable = variable,
                quantifier = quantifier,
                parts = parts,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): GraphMatchPattern =
            GraphMatchPattern(
                restrictor = restrictor,
                prefilter = prefilter,
                variable = variable,
                quantifier = quantifier,
                parts = parts,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("graph_match_pattern"),
                restrictor?.toIonElement() ?: ionNull(),
                prefilter?.toIonElement() ?: ionNull(),
                variable?.toIonElement() ?: ionNull(),
                quantifier?.toIonElement() ?: ionNull(),
                *parts.map { it.toIonElement() }.toTypedArray(),
                metas = metas)
            return elements
        }
    
        fun copy(
            restrictor: GraphMatchRestrictor? = this.restrictor,
            prefilter: Expr? = this.prefilter,
            variable: org.partiql.pig.runtime.SymbolPrimitive? = this.variable,
            quantifier: GraphMatchQuantifier? = this.quantifier,
            parts: kotlin.collections.List = this.parts,
            metas: MetaContainer = this.metas
        ) =
            GraphMatchPattern(
                restrictor,
                prefilter,
                variable,
                quantifier,
                parts,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != GraphMatchPattern::class.java) return false
    
            other as GraphMatchPattern
            if (restrictor != other.restrictor) return false
            if (prefilter != other.prefilter) return false
            if (variable != other.variable) return false
            if (quantifier != other.quantifier) return false
            if (parts != other.parts) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = restrictor.hashCode()
            hc = 31 * hc + prefilter.hashCode()
            hc = 31 * hc + variable.hashCode()
            hc = 31 * hc + quantifier.hashCode()
            hc = 31 * hc + parts.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class GpmlPattern(
        val selector: GraphMatchSelector?,
        val patterns: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): GpmlPattern =
            GpmlPattern(
                selector = selector,
                patterns = patterns,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): GpmlPattern =
            GpmlPattern(
                selector = selector,
                patterns = patterns,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("gpml_pattern"),
                selector?.toIonElement() ?: ionNull(),
                *patterns.map { it.toIonElement() }.toTypedArray(),
                metas = metas)
            return elements
        }
    
        fun copy(
            selector: GraphMatchSelector? = this.selector,
            patterns: kotlin.collections.List = this.patterns,
            metas: MetaContainer = this.metas
        ) =
            GpmlPattern(
                selector,
                patterns,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != GpmlPattern::class.java) return false
    
            other as GpmlPattern
            if (selector != other.selector) return false
            if (patterns != other.patterns) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = selector.hashCode()
            hc = 31 * hc + patterns.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class ExprPair(
        val first: Expr,
        val second: Expr,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): ExprPair =
            ExprPair(
                first = first,
                second = second,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): ExprPair =
            ExprPair(
                first = first,
                second = second,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("expr_pair"),
                first.toIonElement(),
                second.toIonElement(),
                metas = metas)
            return elements
        }
    
        fun copy(
            first: Expr = this.first,
            second: Expr = this.second,
            metas: MetaContainer = this.metas
        ) =
            ExprPair(
                first,
                second,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != ExprPair::class.java) return false
    
            other as ExprPair
            if (first != other.first) return false
            if (second != other.second) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = first.hashCode()
            hc = 31 * hc + second.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class ExprPairList(
        val pairs: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): ExprPairList =
            ExprPairList(
                pairs = pairs,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): ExprPairList =
            ExprPairList(
                pairs = pairs,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("expr_pair_list"),
                *pairs.map { it.toIonElement() }.toTypedArray(),
                metas = metas)
            return elements
        }
    
        fun copy(
            pairs: kotlin.collections.List = this.pairs,
            metas: MetaContainer = this.metas
        ) =
            ExprPairList(
                pairs,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != ExprPairList::class.java) return false
    
            other as ExprPairList
            if (pairs != other.pairs) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = pairs.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class GroupBy(
        val strategy: GroupingStrategy,
        val keyList: GroupKeyList,
        val groupAsAlias: org.partiql.pig.runtime.SymbolPrimitive?,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): GroupBy =
            GroupBy(
                strategy = strategy,
                keyList = keyList,
                groupAsAlias = groupAsAlias,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): GroupBy =
            GroupBy(
                strategy = strategy,
                keyList = keyList,
                groupAsAlias = groupAsAlias,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("group_by"),
                strategy.toIonElement(),
                keyList.toIonElement(),
                groupAsAlias?.toIonElement() ?: ionNull(),
                metas = metas)
            return elements
        }
    
        fun copy(
            strategy: GroupingStrategy = this.strategy,
            keyList: GroupKeyList = this.keyList,
            groupAsAlias: org.partiql.pig.runtime.SymbolPrimitive? = this.groupAsAlias,
            metas: MetaContainer = this.metas
        ) =
            GroupBy(
                strategy,
                keyList,
                groupAsAlias,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != GroupBy::class.java) return false
    
            other as GroupBy
            if (strategy != other.strategy) return false
            if (keyList != other.keyList) return false
            if (groupAsAlias != other.groupAsAlias) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = strategy.hashCode()
            hc = 31 * hc + keyList.hashCode()
            hc = 31 * hc + groupAsAlias.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class GroupKeyList(
        val keys: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): GroupKeyList =
            GroupKeyList(
                keys = keys,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): GroupKeyList =
            GroupKeyList(
                keys = keys,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("group_key_list"),
                *keys.map { it.toIonElement() }.toTypedArray(),
                metas = metas)
            return elements
        }
    
        fun copy(
            keys: kotlin.collections.List = this.keys,
            metas: MetaContainer = this.metas
        ) =
            GroupKeyList(
                keys,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != GroupKeyList::class.java) return false
    
            other as GroupKeyList
            if (keys != other.keys) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = keys.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class GroupKey(
        val expr: Expr,
        val asAlias: org.partiql.pig.runtime.SymbolPrimitive?,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): GroupKey =
            GroupKey(
                expr = expr,
                asAlias = asAlias,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): GroupKey =
            GroupKey(
                expr = expr,
                asAlias = asAlias,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("group_key"),
                expr.toIonElement(),
                asAlias?.toIonElement() ?: ionNull(),
                metas = metas)
            return elements
        }
    
        fun copy(
            expr: Expr = this.expr,
            asAlias: org.partiql.pig.runtime.SymbolPrimitive? = this.asAlias,
            metas: MetaContainer = this.metas
        ) =
            GroupKey(
                expr,
                asAlias,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != GroupKey::class.java) return false
    
            other as GroupKey
            if (expr != other.expr) return false
            if (asAlias != other.asAlias) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = expr.hashCode()
            hc = 31 * hc + asAlias.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class OrderBy(
        val sortSpecs: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): OrderBy =
            OrderBy(
                sortSpecs = sortSpecs,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): OrderBy =
            OrderBy(
                sortSpecs = sortSpecs,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("order_by"),
                *sortSpecs.map { it.toIonElement() }.toTypedArray(),
                metas = metas)
            return elements
        }
    
        fun copy(
            sortSpecs: kotlin.collections.List = this.sortSpecs,
            metas: MetaContainer = this.metas
        ) =
            OrderBy(
                sortSpecs,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != OrderBy::class.java) return false
    
            other as OrderBy
            if (sortSpecs != other.sortSpecs) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = sortSpecs.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class SortSpec(
        val expr: Expr,
        val orderingSpec: OrderingSpec?,
        val nullsSpec: NullsSpec?,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): SortSpec =
            SortSpec(
                expr = expr,
                orderingSpec = orderingSpec,
                nullsSpec = nullsSpec,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): SortSpec =
            SortSpec(
                expr = expr,
                orderingSpec = orderingSpec,
                nullsSpec = nullsSpec,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("sort_spec"),
                expr.toIonElement(),
                orderingSpec?.toIonElement() ?: ionNull(),
                nullsSpec?.toIonElement() ?: ionNull(),
                metas = metas)
            return elements
        }
    
        fun copy(
            expr: Expr = this.expr,
            orderingSpec: OrderingSpec? = this.orderingSpec,
            nullsSpec: NullsSpec? = this.nullsSpec,
            metas: MetaContainer = this.metas
        ) =
            SortSpec(
                expr,
                orderingSpec,
                nullsSpec,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != SortSpec::class.java) return false
    
            other as SortSpec
            if (expr != other.expr) return false
            if (orderingSpec != other.orderingSpec) return false
            if (nullsSpec != other.nullsSpec) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = expr.hashCode()
            hc = 31 * hc + orderingSpec.hashCode()
            hc = 31 * hc + nullsSpec.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class Over(
        val partitionBy: WindowPartitionList?,
        val orderBy: WindowSortSpecList?,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): Over =
            Over(
                partitionBy = partitionBy,
                orderBy = orderBy,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): Over =
            Over(
                partitionBy = partitionBy,
                orderBy = orderBy,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("over"),
                partitionBy?.toIonElement() ?: ionNull(),
                orderBy?.toIonElement() ?: ionNull(),
                metas = metas)
            return elements
        }
    
        fun copy(
            partitionBy: WindowPartitionList? = this.partitionBy,
            orderBy: WindowSortSpecList? = this.orderBy,
            metas: MetaContainer = this.metas
        ) =
            Over(
                partitionBy,
                orderBy,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != Over::class.java) return false
    
            other as Over
            if (partitionBy != other.partitionBy) return false
            if (orderBy != other.orderBy) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = partitionBy.hashCode()
            hc = 31 * hc + orderBy.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class WindowPartitionList(
        val exprs: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): WindowPartitionList =
            WindowPartitionList(
                exprs = exprs,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): WindowPartitionList =
            WindowPartitionList(
                exprs = exprs,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("window_partition_list"),
                *exprs.map { it.toIonElement() }.toTypedArray(),
                metas = metas)
            return elements
        }
    
        fun copy(
            exprs: kotlin.collections.List = this.exprs,
            metas: MetaContainer = this.metas
        ) =
            WindowPartitionList(
                exprs,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != WindowPartitionList::class.java) return false
    
            other as WindowPartitionList
            if (exprs != other.exprs) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = exprs.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class WindowSortSpecList(
        val sortSpecs: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): WindowSortSpecList =
            WindowSortSpecList(
                sortSpecs = sortSpecs,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): WindowSortSpecList =
            WindowSortSpecList(
                sortSpecs = sortSpecs,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("window_sort_spec_list"),
                *sortSpecs.map { it.toIonElement() }.toTypedArray(),
                metas = metas)
            return elements
        }
    
        fun copy(
            sortSpecs: kotlin.collections.List = this.sortSpecs,
            metas: MetaContainer = this.metas
        ) =
            WindowSortSpecList(
                sortSpecs,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != WindowSortSpecList::class.java) return false
    
            other as WindowSortSpecList
            if (sortSpecs != other.sortSpecs) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = sortSpecs.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class DmlOpList(
        val ops: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): DmlOpList =
            DmlOpList(
                ops = ops,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): DmlOpList =
            DmlOpList(
                ops = ops,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("dml_op_list"),
                *ops.map { it.toIonElement() }.toTypedArray(),
                metas = metas)
            return elements
        }
    
        fun copy(
            ops: kotlin.collections.List = this.ops,
            metas: MetaContainer = this.metas
        ) =
            DmlOpList(
                ops,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != DmlOpList::class.java) return false
    
            other as DmlOpList
            if (ops != other.ops) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = ops.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class OnConflict(
        val expr: Expr,
        val conflictAction: ConflictAction,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): OnConflict =
            OnConflict(
                expr = expr,
                conflictAction = conflictAction,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): OnConflict =
            OnConflict(
                expr = expr,
                conflictAction = conflictAction,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("on_conflict"),
                expr.toIonElement(),
                conflictAction.toIonElement(),
                metas = metas)
            return elements
        }
    
        fun copy(
            expr: Expr = this.expr,
            conflictAction: ConflictAction = this.conflictAction,
            metas: MetaContainer = this.metas
        ) =
            OnConflict(
                expr,
                conflictAction,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != OnConflict::class.java) return false
    
            other as OnConflict
            if (expr != other.expr) return false
            if (conflictAction != other.conflictAction) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = expr.hashCode()
            hc = 31 * hc + conflictAction.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class ReturningExpr(
        val elems: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): ReturningExpr =
            ReturningExpr(
                elems = elems,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): ReturningExpr =
            ReturningExpr(
                elems = elems,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("returning_expr"),
                *elems.map { it.toIonElement() }.toTypedArray(),
                metas = metas)
            return elements
        }
    
        fun copy(
            elems: kotlin.collections.List = this.elems,
            metas: MetaContainer = this.metas
        ) =
            ReturningExpr(
                elems,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != ReturningExpr::class.java) return false
    
            other as ReturningExpr
            if (elems != other.elems) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = elems.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class ReturningElem(
        val mapping: ReturningMapping,
        val column: ColumnComponent,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): ReturningElem =
            ReturningElem(
                mapping = mapping,
                column = column,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): ReturningElem =
            ReturningElem(
                mapping = mapping,
                column = column,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("returning_elem"),
                mapping.toIonElement(),
                column.toIonElement(),
                metas = metas)
            return elements
        }
    
        fun copy(
            mapping: ReturningMapping = this.mapping,
            column: ColumnComponent = this.column,
            metas: MetaContainer = this.metas
        ) =
            ReturningElem(
                mapping,
                column,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != ReturningElem::class.java) return false
    
            other as ReturningElem
            if (mapping != other.mapping) return false
            if (column != other.column) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = mapping.hashCode()
            hc = 31 * hc + column.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class Identifier(
        val name: org.partiql.pig.runtime.SymbolPrimitive,
        val case: CaseSensitivity,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): Identifier =
            Identifier(
                name = name,
                case = case,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): Identifier =
            Identifier(
                name = name,
                case = case,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("identifier"),
                name.toIonElement(),
                case.toIonElement(),
                metas = metas)
            return elements
        }
    
        fun copy(
            name: org.partiql.pig.runtime.SymbolPrimitive = this.name,
            case: CaseSensitivity = this.case,
            metas: MetaContainer = this.metas
        ) =
            Identifier(
                name,
                case,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != Identifier::class.java) return false
    
            other as Identifier
            if (name != other.name) return false
            if (case != other.case) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = name.hashCode()
            hc = 31 * hc + case.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class Assignment(
        val target: Expr,
        val value: Expr,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlAstNode() {
    
        override fun copy(metas: MetaContainer): Assignment =
            Assignment(
                target = target,
                value = value,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): Assignment =
            Assignment(
                target = target,
                value = value,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("assignment"),
                target.toIonElement(),
                value.toIonElement(),
                metas = metas)
            return elements
        }
    
        fun copy(
            target: Expr = this.target,
            value: Expr = this.value,
            metas: MetaContainer = this.metas
        ) =
            Assignment(
                target,
                value,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != Assignment::class.java) return false
    
            other as Assignment
            if (target != other.target) return false
            if (value != other.value) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = target.hashCode()
            hc = 31 * hc + value.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    
    /////////////////////////////////////////////////////////////////////////////
    // Sum Types
    /////////////////////////////////////////////////////////////////////////////
    
    sealed class Statement(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): Statement =
            when (this) {
                is Query -> copy(metas = metas)
                is Dml -> copy(metas = metas)
                is Ddl -> copy(metas = metas)
                is Exec -> copy(metas = metas)
                is Explain -> copy(metas = metas)
            }
    
        class Query(
            val expr: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Statement() {
        
            override fun copy(metas: MetaContainer): Query =
                Query(
                    expr = expr,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Query =
                Query(
                    expr = expr,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("query"),
                    expr.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                expr: Expr = this.expr,
                metas: MetaContainer = this.metas
            ) =
                Query(
                    expr,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Query::class.java) return false
        
                other as Query
                if (expr != other.expr) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = expr.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Dml(
            val operations: DmlOpList,
            val from: FromSource?,
            val where: Expr?,
            val returning: ReturningExpr?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Statement() {
        
            override fun copy(metas: MetaContainer): Dml =
                Dml(
                    operations = operations,
                    from = from,
                    where = where,
                    returning = returning,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Dml =
                Dml(
                    operations = operations,
                    from = from,
                    where = where,
                    returning = returning,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = listOfNotNull(
                    ionSymbol("dml"),
                    operations?.let { ionSexpOf(ionSymbol("operations"), it.toIonElement()) },
                    from?.let { ionSexpOf(ionSymbol("from"), it.toIonElement()) },
                    where?.let { ionSexpOf(ionSymbol("where"), it.toIonElement()) },
                    returning?.let { ionSexpOf(ionSymbol("returning"), it.toIonElement()) }
                )
        
                return ionSexpOf(elements, metas = metas)
            }
        
            fun copy(
                operations: DmlOpList = this.operations,
                from: FromSource? = this.from,
                where: Expr? = this.where,
                returning: ReturningExpr? = this.returning,
                metas: MetaContainer = this.metas
            ) =
                Dml(
                    operations,
                    from,
                    where,
                    returning,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Dml::class.java) return false
        
                other as Dml
                if (operations != other.operations) return false
                if (from != other.from) return false
                if (where != other.where) return false
                if (returning != other.returning) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operations.hashCode()
                hc = 31 * hc + from.hashCode()
                hc = 31 * hc + where.hashCode()
                hc = 31 * hc + returning.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Ddl(
            val op: DdlOp,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Statement() {
        
            override fun copy(metas: MetaContainer): Ddl =
                Ddl(
                    op = op,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Ddl =
                Ddl(
                    op = op,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("ddl"),
                    op.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                op: DdlOp = this.op,
                metas: MetaContainer = this.metas
            ) =
                Ddl(
                    op,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Ddl::class.java) return false
        
                other as Ddl
                if (op != other.op) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = op.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Exec(
            val procedureName: org.partiql.pig.runtime.SymbolPrimitive,
            val args: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Statement() {
        
            override fun copy(metas: MetaContainer): Exec =
                Exec(
                    procedureName = procedureName,
                    args = args,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Exec =
                Exec(
                    procedureName = procedureName,
                    args = args,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("exec"),
                    procedureName.toIonElement(),
                    *args.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                procedureName: org.partiql.pig.runtime.SymbolPrimitive = this.procedureName,
                args: kotlin.collections.List = this.args,
                metas: MetaContainer = this.metas
            ) =
                Exec(
                    procedureName,
                    args,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Exec::class.java) return false
        
                other as Exec
                if (procedureName != other.procedureName) return false
                if (args != other.args) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = procedureName.hashCode()
                hc = 31 * hc + args.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Explain(
            val target: ExplainTarget,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Statement() {
        
            override fun copy(metas: MetaContainer): Explain =
                Explain(
                    target = target,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Explain =
                Explain(
                    target = target,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("explain"),
                    target.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                target: ExplainTarget = this.target,
                metas: MetaContainer = this.metas
            ) =
                Explain(
                    target,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Explain::class.java) return false
        
                other as Explain
                if (target != other.target) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = target.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlAst.Statement] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.Statement): T = when(node) {
                is PartiqlAst.Statement.Query -> convertQuery(node)
                is PartiqlAst.Statement.Dml -> convertDml(node)
                is PartiqlAst.Statement.Ddl -> convertDdl(node)
                is PartiqlAst.Statement.Exec -> convertExec(node)
                is PartiqlAst.Statement.Explain -> convertExplain(node)
            }
    
            fun convertQuery(node: PartiqlAst.Statement.Query): T
            fun convertDml(node: PartiqlAst.Statement.Dml): T
            fun convertDdl(node: PartiqlAst.Statement.Ddl): T
            fun convertExec(node: PartiqlAst.Statement.Exec): T
            fun convertExplain(node: PartiqlAst.Statement.Explain): T
        }
    }
    
    sealed class ExplainTarget(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): ExplainTarget =
            when (this) {
                is Domain -> copy(metas = metas)
            }
    
        class Domain(
            val statement: Statement,
            val type: org.partiql.pig.runtime.SymbolPrimitive?,
            val format: org.partiql.pig.runtime.SymbolPrimitive?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): ExplainTarget() {
        
            override fun copy(metas: MetaContainer): Domain =
                Domain(
                    statement = statement,
                    type = type,
                    format = format,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Domain =
                Domain(
                    statement = statement,
                    type = type,
                    format = format,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("domain"),
                    statement.toIonElement(),
                    type?.toIonElement() ?: ionNull(),
                    format?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                statement: Statement = this.statement,
                type: org.partiql.pig.runtime.SymbolPrimitive? = this.type,
                format: org.partiql.pig.runtime.SymbolPrimitive? = this.format,
                metas: MetaContainer = this.metas
            ) =
                Domain(
                    statement,
                    type,
                    format,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Domain::class.java) return false
        
                other as Domain
                if (statement != other.statement) return false
                if (type != other.type) return false
                if (format != other.format) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = statement.hashCode()
                hc = 31 * hc + type.hashCode()
                hc = 31 * hc + format.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlAst.ExplainTarget] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.ExplainTarget): T = when(node) {
                is PartiqlAst.ExplainTarget.Domain -> convertDomain(node)
            }
    
            fun convertDomain(node: PartiqlAst.ExplainTarget.Domain): T
        }
    }
    
    sealed class Expr(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): Expr =
            when (this) {
                is Missing -> copy(metas = metas)
                is Lit -> copy(metas = metas)
                is Id -> copy(metas = metas)
                is Parameter -> copy(metas = metas)
                is Not -> copy(metas = metas)
                is Pos -> copy(metas = metas)
                is Neg -> copy(metas = metas)
                is Plus -> copy(metas = metas)
                is Minus -> copy(metas = metas)
                is Times -> copy(metas = metas)
                is Divide -> copy(metas = metas)
                is Modulo -> copy(metas = metas)
                is Concat -> copy(metas = metas)
                is And -> copy(metas = metas)
                is Or -> copy(metas = metas)
                is Eq -> copy(metas = metas)
                is Ne -> copy(metas = metas)
                is Gt -> copy(metas = metas)
                is Gte -> copy(metas = metas)
                is Lt -> copy(metas = metas)
                is Lte -> copy(metas = metas)
                is Like -> copy(metas = metas)
                is Between -> copy(metas = metas)
                is InCollection -> copy(metas = metas)
                is IsType -> copy(metas = metas)
                is SimpleCase -> copy(metas = metas)
                is SearchedCase -> copy(metas = metas)
                is Struct -> copy(metas = metas)
                is Bag -> copy(metas = metas)
                is List -> copy(metas = metas)
                is Sexp -> copy(metas = metas)
                is Date -> copy(metas = metas)
                is LitTime -> copy(metas = metas)
                is BagOp -> copy(metas = metas)
                is GraphMatch -> copy(metas = metas)
                is Path -> copy(metas = metas)
                is Call -> copy(metas = metas)
                is CallAgg -> copy(metas = metas)
                is CallWindow -> copy(metas = metas)
                is Cast -> copy(metas = metas)
                is CanCast -> copy(metas = metas)
                is CanLosslessCast -> copy(metas = metas)
                is NullIf -> copy(metas = metas)
                is Coalesce -> copy(metas = metas)
                is Select -> copy(metas = metas)
            }
    
        class Missing(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Missing =
                Missing(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Missing =
                Missing(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("missing"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Missing::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 3000
        }
    
        class Lit(
            val value: com.amazon.ionelement.api.AnyElement,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Lit =
                Lit(
                    value = value,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Lit =
                Lit(
                    value = value,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("lit"),
                    value.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                value: com.amazon.ionelement.api.AnyElement = this.value,
                metas: MetaContainer = this.metas
            ) =
                Lit(
                    value,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Lit::class.java) return false
        
                other as Lit
                if (value != other.value) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = value.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Id(
            val name: org.partiql.pig.runtime.SymbolPrimitive,
            val case: CaseSensitivity,
            val qualifier: ScopeQualifier,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Id =
                Id(
                    name = name,
                    case = case,
                    qualifier = qualifier,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Id =
                Id(
                    name = name,
                    case = case,
                    qualifier = qualifier,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("id"),
                    name.toIonElement(),
                    case.toIonElement(),
                    qualifier.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                name: org.partiql.pig.runtime.SymbolPrimitive = this.name,
                case: CaseSensitivity = this.case,
                qualifier: ScopeQualifier = this.qualifier,
                metas: MetaContainer = this.metas
            ) =
                Id(
                    name,
                    case,
                    qualifier,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Id::class.java) return false
        
                other as Id
                if (name != other.name) return false
                if (case != other.case) return false
                if (qualifier != other.qualifier) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = name.hashCode()
                hc = 31 * hc + case.hashCode()
                hc = 31 * hc + qualifier.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Parameter(
            val index: org.partiql.pig.runtime.LongPrimitive,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Parameter =
                Parameter(
                    index = index,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Parameter =
                Parameter(
                    index = index,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("parameter"),
                    index.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                index: org.partiql.pig.runtime.LongPrimitive = this.index,
                metas: MetaContainer = this.metas
            ) =
                Parameter(
                    index,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Parameter::class.java) return false
        
                other as Parameter
                if (index != other.index) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = index.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Not(
            val expr: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Not =
                Not(
                    expr = expr,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Not =
                Not(
                    expr = expr,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("not"),
                    expr.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                expr: Expr = this.expr,
                metas: MetaContainer = this.metas
            ) =
                Not(
                    expr,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Not::class.java) return false
        
                other as Not
                if (expr != other.expr) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = expr.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Pos(
            val expr: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Pos =
                Pos(
                    expr = expr,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Pos =
                Pos(
                    expr = expr,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("pos"),
                    expr.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                expr: Expr = this.expr,
                metas: MetaContainer = this.metas
            ) =
                Pos(
                    expr,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Pos::class.java) return false
        
                other as Pos
                if (expr != other.expr) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = expr.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Neg(
            val expr: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Neg =
                Neg(
                    expr = expr,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Neg =
                Neg(
                    expr = expr,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("neg"),
                    expr.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                expr: Expr = this.expr,
                metas: MetaContainer = this.metas
            ) =
                Neg(
                    expr,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Neg::class.java) return false
        
                other as Neg
                if (expr != other.expr) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = expr.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Plus(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Plus =
                Plus(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Plus =
                Plus(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("plus"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                Plus(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Plus::class.java) return false
        
                other as Plus
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Minus(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Minus =
                Minus(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Minus =
                Minus(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("minus"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                Minus(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Minus::class.java) return false
        
                other as Minus
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Times(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Times =
                Times(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Times =
                Times(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("times"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                Times(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Times::class.java) return false
        
                other as Times
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Divide(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Divide =
                Divide(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Divide =
                Divide(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("divide"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                Divide(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Divide::class.java) return false
        
                other as Divide
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Modulo(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Modulo =
                Modulo(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Modulo =
                Modulo(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("modulo"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                Modulo(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Modulo::class.java) return false
        
                other as Modulo
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Concat(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Concat =
                Concat(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Concat =
                Concat(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("concat"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                Concat(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Concat::class.java) return false
        
                other as Concat
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class And(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): And =
                And(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): And =
                And(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("and"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                And(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != And::class.java) return false
        
                other as And
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Or(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Or =
                Or(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Or =
                Or(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("or"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                Or(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Or::class.java) return false
        
                other as Or
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Eq(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Eq =
                Eq(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Eq =
                Eq(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("eq"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                Eq(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Eq::class.java) return false
        
                other as Eq
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Ne(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Ne =
                Ne(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Ne =
                Ne(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("ne"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                Ne(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Ne::class.java) return false
        
                other as Ne
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Gt(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Gt =
                Gt(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Gt =
                Gt(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("gt"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                Gt(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Gt::class.java) return false
        
                other as Gt
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Gte(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Gte =
                Gte(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Gte =
                Gte(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("gte"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                Gte(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Gte::class.java) return false
        
                other as Gte
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Lt(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Lt =
                Lt(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Lt =
                Lt(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("lt"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                Lt(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Lt::class.java) return false
        
                other as Lt
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Lte(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Lte =
                Lte(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Lte =
                Lte(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("lte"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                Lte(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Lte::class.java) return false
        
                other as Lte
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Like(
            val value: Expr,
            val pattern: Expr,
            val escape: Expr?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Like =
                Like(
                    value = value,
                    pattern = pattern,
                    escape = escape,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Like =
                Like(
                    value = value,
                    pattern = pattern,
                    escape = escape,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("like"),
                    value.toIonElement(),
                    pattern.toIonElement(),
                    escape?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                value: Expr = this.value,
                pattern: Expr = this.pattern,
                escape: Expr? = this.escape,
                metas: MetaContainer = this.metas
            ) =
                Like(
                    value,
                    pattern,
                    escape,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Like::class.java) return false
        
                other as Like
                if (value != other.value) return false
                if (pattern != other.pattern) return false
                if (escape != other.escape) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = value.hashCode()
                hc = 31 * hc + pattern.hashCode()
                hc = 31 * hc + escape.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Between(
            val value: Expr,
            val from: Expr,
            val to: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Between =
                Between(
                    value = value,
                    from = from,
                    to = to,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Between =
                Between(
                    value = value,
                    from = from,
                    to = to,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("between"),
                    value.toIonElement(),
                    from.toIonElement(),
                    to.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                value: Expr = this.value,
                from: Expr = this.from,
                to: Expr = this.to,
                metas: MetaContainer = this.metas
            ) =
                Between(
                    value,
                    from,
                    to,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Between::class.java) return false
        
                other as Between
                if (value != other.value) return false
                if (from != other.from) return false
                if (to != other.to) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = value.hashCode()
                hc = 31 * hc + from.hashCode()
                hc = 31 * hc + to.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class InCollection(
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): InCollection =
                InCollection(
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): InCollection =
                InCollection(
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("in_collection"),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                InCollection(
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != InCollection::class.java) return false
        
                other as InCollection
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class IsType(
            val value: Expr,
            val type: Type,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): IsType =
                IsType(
                    value = value,
                    type = type,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): IsType =
                IsType(
                    value = value,
                    type = type,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("is_type"),
                    value.toIonElement(),
                    type.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                value: Expr = this.value,
                type: Type = this.type,
                metas: MetaContainer = this.metas
            ) =
                IsType(
                    value,
                    type,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != IsType::class.java) return false
        
                other as IsType
                if (value != other.value) return false
                if (type != other.type) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = value.hashCode()
                hc = 31 * hc + type.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class SimpleCase(
            val expr: Expr,
            val cases: ExprPairList,
            val default: Expr?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): SimpleCase =
                SimpleCase(
                    expr = expr,
                    cases = cases,
                    default = default,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): SimpleCase =
                SimpleCase(
                    expr = expr,
                    cases = cases,
                    default = default,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("simple_case"),
                    expr.toIonElement(),
                    cases.toIonElement(),
                    default?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                expr: Expr = this.expr,
                cases: ExprPairList = this.cases,
                default: Expr? = this.default,
                metas: MetaContainer = this.metas
            ) =
                SimpleCase(
                    expr,
                    cases,
                    default,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != SimpleCase::class.java) return false
        
                other as SimpleCase
                if (expr != other.expr) return false
                if (cases != other.cases) return false
                if (default != other.default) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = expr.hashCode()
                hc = 31 * hc + cases.hashCode()
                hc = 31 * hc + default.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class SearchedCase(
            val cases: ExprPairList,
            val default: Expr?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): SearchedCase =
                SearchedCase(
                    cases = cases,
                    default = default,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): SearchedCase =
                SearchedCase(
                    cases = cases,
                    default = default,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("searched_case"),
                    cases.toIonElement(),
                    default?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                cases: ExprPairList = this.cases,
                default: Expr? = this.default,
                metas: MetaContainer = this.metas
            ) =
                SearchedCase(
                    cases,
                    default,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != SearchedCase::class.java) return false
        
                other as SearchedCase
                if (cases != other.cases) return false
                if (default != other.default) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = cases.hashCode()
                hc = 31 * hc + default.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Struct(
            val fields: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Struct =
                Struct(
                    fields = fields,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Struct =
                Struct(
                    fields = fields,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("struct"),
                    *fields.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                fields: kotlin.collections.List = this.fields,
                metas: MetaContainer = this.metas
            ) =
                Struct(
                    fields,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Struct::class.java) return false
        
                other as Struct
                if (fields != other.fields) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = fields.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Bag(
            val values: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Bag =
                Bag(
                    values = values,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Bag =
                Bag(
                    values = values,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("bag"),
                    *values.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                values: kotlin.collections.List = this.values,
                metas: MetaContainer = this.metas
            ) =
                Bag(
                    values,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Bag::class.java) return false
        
                other as Bag
                if (values != other.values) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = values.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class List(
            val values: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): List =
                List(
                    values = values,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): List =
                List(
                    values = values,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("list"),
                    *values.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                values: kotlin.collections.List = this.values,
                metas: MetaContainer = this.metas
            ) =
                List(
                    values,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != List::class.java) return false
        
                other as List
                if (values != other.values) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = values.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Sexp(
            val values: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Sexp =
                Sexp(
                    values = values,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Sexp =
                Sexp(
                    values = values,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("sexp"),
                    *values.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                values: kotlin.collections.List = this.values,
                metas: MetaContainer = this.metas
            ) =
                Sexp(
                    values,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Sexp::class.java) return false
        
                other as Sexp
                if (values != other.values) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = values.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Date(
            val year: org.partiql.pig.runtime.LongPrimitive,
            val month: org.partiql.pig.runtime.LongPrimitive,
            val day: org.partiql.pig.runtime.LongPrimitive,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Date =
                Date(
                    year = year,
                    month = month,
                    day = day,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Date =
                Date(
                    year = year,
                    month = month,
                    day = day,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("date"),
                    year.toIonElement(),
                    month.toIonElement(),
                    day.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                year: org.partiql.pig.runtime.LongPrimitive = this.year,
                month: org.partiql.pig.runtime.LongPrimitive = this.month,
                day: org.partiql.pig.runtime.LongPrimitive = this.day,
                metas: MetaContainer = this.metas
            ) =
                Date(
                    year,
                    month,
                    day,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Date::class.java) return false
        
                other as Date
                if (year != other.year) return false
                if (month != other.month) return false
                if (day != other.day) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = year.hashCode()
                hc = 31 * hc + month.hashCode()
                hc = 31 * hc + day.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class LitTime(
            val value: TimeValue,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): LitTime =
                LitTime(
                    value = value,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): LitTime =
                LitTime(
                    value = value,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("lit_time"),
                    value.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                value: TimeValue = this.value,
                metas: MetaContainer = this.metas
            ) =
                LitTime(
                    value,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != LitTime::class.java) return false
        
                other as LitTime
                if (value != other.value) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = value.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class BagOp(
            val op: BagOpType,
            val quantifier: SetQuantifier,
            val operands: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): BagOp =
                BagOp(
                    op = op,
                    quantifier = quantifier,
                    operands = operands,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): BagOp =
                BagOp(
                    op = op,
                    quantifier = quantifier,
                    operands = operands,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("bag_op"),
                    op.toIonElement(),
                    quantifier.toIonElement(),
                    *operands.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                op: BagOpType = this.op,
                quantifier: SetQuantifier = this.quantifier,
                operands: kotlin.collections.List = this.operands,
                metas: MetaContainer = this.metas
            ) =
                BagOp(
                    op,
                    quantifier,
                    operands,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != BagOp::class.java) return false
        
                other as BagOp
                if (op != other.op) return false
                if (quantifier != other.quantifier) return false
                if (operands != other.operands) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = op.hashCode()
                hc = 31 * hc + quantifier.hashCode()
                hc = 31 * hc + operands.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class GraphMatch(
            val expr: Expr,
            val gpmlPattern: GpmlPattern,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): GraphMatch =
                GraphMatch(
                    expr = expr,
                    gpmlPattern = gpmlPattern,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): GraphMatch =
                GraphMatch(
                    expr = expr,
                    gpmlPattern = gpmlPattern,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("graph_match"),
                    expr.toIonElement(),
                    gpmlPattern.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                expr: Expr = this.expr,
                gpmlPattern: GpmlPattern = this.gpmlPattern,
                metas: MetaContainer = this.metas
            ) =
                GraphMatch(
                    expr,
                    gpmlPattern,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != GraphMatch::class.java) return false
        
                other as GraphMatch
                if (expr != other.expr) return false
                if (gpmlPattern != other.gpmlPattern) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = expr.hashCode()
                hc = 31 * hc + gpmlPattern.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Path(
            val root: Expr,
            val steps: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Path =
                Path(
                    root = root,
                    steps = steps,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Path =
                Path(
                    root = root,
                    steps = steps,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("path"),
                    root.toIonElement(),
                    *steps.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                root: Expr = this.root,
                steps: kotlin.collections.List = this.steps,
                metas: MetaContainer = this.metas
            ) =
                Path(
                    root,
                    steps,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Path::class.java) return false
        
                other as Path
                if (root != other.root) return false
                if (steps != other.steps) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = root.hashCode()
                hc = 31 * hc + steps.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Call(
            val funcName: org.partiql.pig.runtime.SymbolPrimitive,
            val args: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Call =
                Call(
                    funcName = funcName,
                    args = args,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Call =
                Call(
                    funcName = funcName,
                    args = args,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("call"),
                    funcName.toIonElement(),
                    *args.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                funcName: org.partiql.pig.runtime.SymbolPrimitive = this.funcName,
                args: kotlin.collections.List = this.args,
                metas: MetaContainer = this.metas
            ) =
                Call(
                    funcName,
                    args,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Call::class.java) return false
        
                other as Call
                if (funcName != other.funcName) return false
                if (args != other.args) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = funcName.hashCode()
                hc = 31 * hc + args.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class CallAgg(
            val setq: SetQuantifier,
            val funcName: org.partiql.pig.runtime.SymbolPrimitive,
            val arg: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): CallAgg =
                CallAgg(
                    setq = setq,
                    funcName = funcName,
                    arg = arg,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): CallAgg =
                CallAgg(
                    setq = setq,
                    funcName = funcName,
                    arg = arg,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("call_agg"),
                    setq.toIonElement(),
                    funcName.toIonElement(),
                    arg.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                setq: SetQuantifier = this.setq,
                funcName: org.partiql.pig.runtime.SymbolPrimitive = this.funcName,
                arg: Expr = this.arg,
                metas: MetaContainer = this.metas
            ) =
                CallAgg(
                    setq,
                    funcName,
                    arg,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != CallAgg::class.java) return false
        
                other as CallAgg
                if (setq != other.setq) return false
                if (funcName != other.funcName) return false
                if (arg != other.arg) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = setq.hashCode()
                hc = 31 * hc + funcName.hashCode()
                hc = 31 * hc + arg.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class CallWindow(
            val funcName: org.partiql.pig.runtime.SymbolPrimitive,
            val over: Over,
            val args: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): CallWindow =
                CallWindow(
                    funcName = funcName,
                    over = over,
                    args = args,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): CallWindow =
                CallWindow(
                    funcName = funcName,
                    over = over,
                    args = args,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("call_window"),
                    funcName.toIonElement(),
                    over.toIonElement(),
                    *args.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                funcName: org.partiql.pig.runtime.SymbolPrimitive = this.funcName,
                over: Over = this.over,
                args: kotlin.collections.List = this.args,
                metas: MetaContainer = this.metas
            ) =
                CallWindow(
                    funcName,
                    over,
                    args,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != CallWindow::class.java) return false
        
                other as CallWindow
                if (funcName != other.funcName) return false
                if (over != other.over) return false
                if (args != other.args) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = funcName.hashCode()
                hc = 31 * hc + over.hashCode()
                hc = 31 * hc + args.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Cast(
            val value: Expr,
            val asType: Type,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Cast =
                Cast(
                    value = value,
                    asType = asType,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Cast =
                Cast(
                    value = value,
                    asType = asType,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("cast"),
                    value.toIonElement(),
                    asType.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                value: Expr = this.value,
                asType: Type = this.asType,
                metas: MetaContainer = this.metas
            ) =
                Cast(
                    value,
                    asType,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Cast::class.java) return false
        
                other as Cast
                if (value != other.value) return false
                if (asType != other.asType) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = value.hashCode()
                hc = 31 * hc + asType.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class CanCast(
            val value: Expr,
            val asType: Type,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): CanCast =
                CanCast(
                    value = value,
                    asType = asType,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): CanCast =
                CanCast(
                    value = value,
                    asType = asType,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("can_cast"),
                    value.toIonElement(),
                    asType.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                value: Expr = this.value,
                asType: Type = this.asType,
                metas: MetaContainer = this.metas
            ) =
                CanCast(
                    value,
                    asType,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != CanCast::class.java) return false
        
                other as CanCast
                if (value != other.value) return false
                if (asType != other.asType) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = value.hashCode()
                hc = 31 * hc + asType.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class CanLosslessCast(
            val value: Expr,
            val asType: Type,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): CanLosslessCast =
                CanLosslessCast(
                    value = value,
                    asType = asType,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): CanLosslessCast =
                CanLosslessCast(
                    value = value,
                    asType = asType,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("can_lossless_cast"),
                    value.toIonElement(),
                    asType.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                value: Expr = this.value,
                asType: Type = this.asType,
                metas: MetaContainer = this.metas
            ) =
                CanLosslessCast(
                    value,
                    asType,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != CanLosslessCast::class.java) return false
        
                other as CanLosslessCast
                if (value != other.value) return false
                if (asType != other.asType) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = value.hashCode()
                hc = 31 * hc + asType.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class NullIf(
            val expr1: Expr,
            val expr2: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): NullIf =
                NullIf(
                    expr1 = expr1,
                    expr2 = expr2,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): NullIf =
                NullIf(
                    expr1 = expr1,
                    expr2 = expr2,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("null_if"),
                    expr1.toIonElement(),
                    expr2.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                expr1: Expr = this.expr1,
                expr2: Expr = this.expr2,
                metas: MetaContainer = this.metas
            ) =
                NullIf(
                    expr1,
                    expr2,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != NullIf::class.java) return false
        
                other as NullIf
                if (expr1 != other.expr1) return false
                if (expr2 != other.expr2) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = expr1.hashCode()
                hc = 31 * hc + expr2.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Coalesce(
            val args: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Coalesce =
                Coalesce(
                    args = args,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Coalesce =
                Coalesce(
                    args = args,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("coalesce"),
                    *args.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                args: kotlin.collections.List = this.args,
                metas: MetaContainer = this.metas
            ) =
                Coalesce(
                    args,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Coalesce::class.java) return false
        
                other as Coalesce
                if (args != other.args) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = args.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Select(
            val setq: SetQuantifier?,
            val project: Projection,
            val from: FromSource,
            val fromLet: Let?,
            val where: Expr?,
            val group: GroupBy?,
            val having: Expr?,
            val order: OrderBy?,
            val limit: Expr?,
            val offset: Expr?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Select =
                Select(
                    setq = setq,
                    project = project,
                    from = from,
                    fromLet = fromLet,
                    where = where,
                    group = group,
                    having = having,
                    order = order,
                    limit = limit,
                    offset = offset,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Select =
                Select(
                    setq = setq,
                    project = project,
                    from = from,
                    fromLet = fromLet,
                    where = where,
                    group = group,
                    having = having,
                    order = order,
                    limit = limit,
                    offset = offset,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = listOfNotNull(
                    ionSymbol("select"),
                    setq?.let { ionSexpOf(ionSymbol("setq"), it.toIonElement()) },
                    project?.let { ionSexpOf(ionSymbol("project"), it.toIonElement()) },
                    from?.let { ionSexpOf(ionSymbol("from"), it.toIonElement()) },
                    fromLet?.let { ionSexpOf(ionSymbol("from_let"), it.toIonElement()) },
                    where?.let { ionSexpOf(ionSymbol("where"), it.toIonElement()) },
                    group?.let { ionSexpOf(ionSymbol("group"), it.toIonElement()) },
                    having?.let { ionSexpOf(ionSymbol("having"), it.toIonElement()) },
                    order?.let { ionSexpOf(ionSymbol("order"), it.toIonElement()) },
                    limit?.let { ionSexpOf(ionSymbol("limit"), it.toIonElement()) },
                    offset?.let { ionSexpOf(ionSymbol("offset"), it.toIonElement()) }
                )
        
                return ionSexpOf(elements, metas = metas)
            }
        
            fun copy(
                setq: SetQuantifier? = this.setq,
                project: Projection = this.project,
                from: FromSource = this.from,
                fromLet: Let? = this.fromLet,
                where: Expr? = this.where,
                group: GroupBy? = this.group,
                having: Expr? = this.having,
                order: OrderBy? = this.order,
                limit: Expr? = this.limit,
                offset: Expr? = this.offset,
                metas: MetaContainer = this.metas
            ) =
                Select(
                    setq,
                    project,
                    from,
                    fromLet,
                    where,
                    group,
                    having,
                    order,
                    limit,
                    offset,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Select::class.java) return false
        
                other as Select
                if (setq != other.setq) return false
                if (project != other.project) return false
                if (from != other.from) return false
                if (fromLet != other.fromLet) return false
                if (where != other.where) return false
                if (group != other.group) return false
                if (having != other.having) return false
                if (order != other.order) return false
                if (limit != other.limit) return false
                if (offset != other.offset) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = setq.hashCode()
                hc = 31 * hc + project.hashCode()
                hc = 31 * hc + from.hashCode()
                hc = 31 * hc + fromLet.hashCode()
                hc = 31 * hc + where.hashCode()
                hc = 31 * hc + group.hashCode()
                hc = 31 * hc + having.hashCode()
                hc = 31 * hc + order.hashCode()
                hc = 31 * hc + limit.hashCode()
                hc = 31 * hc + offset.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlAst.Expr] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.Expr): T = when(node) {
                is PartiqlAst.Expr.Missing -> convertMissing(node)
                is PartiqlAst.Expr.Lit -> convertLit(node)
                is PartiqlAst.Expr.Id -> convertId(node)
                is PartiqlAst.Expr.Parameter -> convertParameter(node)
                is PartiqlAst.Expr.Not -> convertNot(node)
                is PartiqlAst.Expr.Pos -> convertPos(node)
                is PartiqlAst.Expr.Neg -> convertNeg(node)
                is PartiqlAst.Expr.Plus -> convertPlus(node)
                is PartiqlAst.Expr.Minus -> convertMinus(node)
                is PartiqlAst.Expr.Times -> convertTimes(node)
                is PartiqlAst.Expr.Divide -> convertDivide(node)
                is PartiqlAst.Expr.Modulo -> convertModulo(node)
                is PartiqlAst.Expr.Concat -> convertConcat(node)
                is PartiqlAst.Expr.And -> convertAnd(node)
                is PartiqlAst.Expr.Or -> convertOr(node)
                is PartiqlAst.Expr.Eq -> convertEq(node)
                is PartiqlAst.Expr.Ne -> convertNe(node)
                is PartiqlAst.Expr.Gt -> convertGt(node)
                is PartiqlAst.Expr.Gte -> convertGte(node)
                is PartiqlAst.Expr.Lt -> convertLt(node)
                is PartiqlAst.Expr.Lte -> convertLte(node)
                is PartiqlAst.Expr.Like -> convertLike(node)
                is PartiqlAst.Expr.Between -> convertBetween(node)
                is PartiqlAst.Expr.InCollection -> convertInCollection(node)
                is PartiqlAst.Expr.IsType -> convertIsType(node)
                is PartiqlAst.Expr.SimpleCase -> convertSimpleCase(node)
                is PartiqlAst.Expr.SearchedCase -> convertSearchedCase(node)
                is PartiqlAst.Expr.Struct -> convertStruct(node)
                is PartiqlAst.Expr.Bag -> convertBag(node)
                is PartiqlAst.Expr.List -> convertList(node)
                is PartiqlAst.Expr.Sexp -> convertSexp(node)
                is PartiqlAst.Expr.Date -> convertDate(node)
                is PartiqlAst.Expr.LitTime -> convertLitTime(node)
                is PartiqlAst.Expr.BagOp -> convertBagOp(node)
                is PartiqlAst.Expr.GraphMatch -> convertGraphMatch(node)
                is PartiqlAst.Expr.Path -> convertPath(node)
                is PartiqlAst.Expr.Call -> convertCall(node)
                is PartiqlAst.Expr.CallAgg -> convertCallAgg(node)
                is PartiqlAst.Expr.CallWindow -> convertCallWindow(node)
                is PartiqlAst.Expr.Cast -> convertCast(node)
                is PartiqlAst.Expr.CanCast -> convertCanCast(node)
                is PartiqlAst.Expr.CanLosslessCast -> convertCanLosslessCast(node)
                is PartiqlAst.Expr.NullIf -> convertNullIf(node)
                is PartiqlAst.Expr.Coalesce -> convertCoalesce(node)
                is PartiqlAst.Expr.Select -> convertSelect(node)
            }
    
            fun convertMissing(node: PartiqlAst.Expr.Missing): T
            fun convertLit(node: PartiqlAst.Expr.Lit): T
            fun convertId(node: PartiqlAst.Expr.Id): T
            fun convertParameter(node: PartiqlAst.Expr.Parameter): T
            fun convertNot(node: PartiqlAst.Expr.Not): T
            fun convertPos(node: PartiqlAst.Expr.Pos): T
            fun convertNeg(node: PartiqlAst.Expr.Neg): T
            fun convertPlus(node: PartiqlAst.Expr.Plus): T
            fun convertMinus(node: PartiqlAst.Expr.Minus): T
            fun convertTimes(node: PartiqlAst.Expr.Times): T
            fun convertDivide(node: PartiqlAst.Expr.Divide): T
            fun convertModulo(node: PartiqlAst.Expr.Modulo): T
            fun convertConcat(node: PartiqlAst.Expr.Concat): T
            fun convertAnd(node: PartiqlAst.Expr.And): T
            fun convertOr(node: PartiqlAst.Expr.Or): T
            fun convertEq(node: PartiqlAst.Expr.Eq): T
            fun convertNe(node: PartiqlAst.Expr.Ne): T
            fun convertGt(node: PartiqlAst.Expr.Gt): T
            fun convertGte(node: PartiqlAst.Expr.Gte): T
            fun convertLt(node: PartiqlAst.Expr.Lt): T
            fun convertLte(node: PartiqlAst.Expr.Lte): T
            fun convertLike(node: PartiqlAst.Expr.Like): T
            fun convertBetween(node: PartiqlAst.Expr.Between): T
            fun convertInCollection(node: PartiqlAst.Expr.InCollection): T
            fun convertIsType(node: PartiqlAst.Expr.IsType): T
            fun convertSimpleCase(node: PartiqlAst.Expr.SimpleCase): T
            fun convertSearchedCase(node: PartiqlAst.Expr.SearchedCase): T
            fun convertStruct(node: PartiqlAst.Expr.Struct): T
            fun convertBag(node: PartiqlAst.Expr.Bag): T
            fun convertList(node: PartiqlAst.Expr.List): T
            fun convertSexp(node: PartiqlAst.Expr.Sexp): T
            fun convertDate(node: PartiqlAst.Expr.Date): T
            fun convertLitTime(node: PartiqlAst.Expr.LitTime): T
            fun convertBagOp(node: PartiqlAst.Expr.BagOp): T
            fun convertGraphMatch(node: PartiqlAst.Expr.GraphMatch): T
            fun convertPath(node: PartiqlAst.Expr.Path): T
            fun convertCall(node: PartiqlAst.Expr.Call): T
            fun convertCallAgg(node: PartiqlAst.Expr.CallAgg): T
            fun convertCallWindow(node: PartiqlAst.Expr.CallWindow): T
            fun convertCast(node: PartiqlAst.Expr.Cast): T
            fun convertCanCast(node: PartiqlAst.Expr.CanCast): T
            fun convertCanLosslessCast(node: PartiqlAst.Expr.CanLosslessCast): T
            fun convertNullIf(node: PartiqlAst.Expr.NullIf): T
            fun convertCoalesce(node: PartiqlAst.Expr.Coalesce): T
            fun convertSelect(node: PartiqlAst.Expr.Select): T
        }
    }
    
    sealed class PathStep(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): PathStep =
            when (this) {
                is PathExpr -> copy(metas = metas)
                is PathWildcard -> copy(metas = metas)
                is PathUnpivot -> copy(metas = metas)
            }
    
        class PathExpr(
            val index: Expr,
            val case: CaseSensitivity,
            override val metas: MetaContainer = emptyMetaContainer()
        ): PathStep() {
        
            override fun copy(metas: MetaContainer): PathExpr =
                PathExpr(
                    index = index,
                    case = case,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): PathExpr =
                PathExpr(
                    index = index,
                    case = case,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("path_expr"),
                    index.toIonElement(),
                    case.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                index: Expr = this.index,
                case: CaseSensitivity = this.case,
                metas: MetaContainer = this.metas
            ) =
                PathExpr(
                    index,
                    case,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != PathExpr::class.java) return false
        
                other as PathExpr
                if (index != other.index) return false
                if (case != other.case) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = index.hashCode()
                hc = 31 * hc + case.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class PathWildcard(
            override val metas: MetaContainer = emptyMetaContainer()
        ): PathStep() {
        
            override fun copy(metas: MetaContainer): PathWildcard =
                PathWildcard(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): PathWildcard =
                PathWildcard(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("path_wildcard"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != PathWildcard::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 4001
        }
    
        class PathUnpivot(
            override val metas: MetaContainer = emptyMetaContainer()
        ): PathStep() {
        
            override fun copy(metas: MetaContainer): PathUnpivot =
                PathUnpivot(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): PathUnpivot =
                PathUnpivot(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("path_unpivot"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != PathUnpivot::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 4002
        }
    
        /** Converts instances of [PartiqlAst.PathStep] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.PathStep): T = when(node) {
                is PartiqlAst.PathStep.PathExpr -> convertPathExpr(node)
                is PartiqlAst.PathStep.PathWildcard -> convertPathWildcard(node)
                is PartiqlAst.PathStep.PathUnpivot -> convertPathUnpivot(node)
            }
    
            fun convertPathExpr(node: PartiqlAst.PathStep.PathExpr): T
            fun convertPathWildcard(node: PartiqlAst.PathStep.PathWildcard): T
            fun convertPathUnpivot(node: PartiqlAst.PathStep.PathUnpivot): T
        }
    }
    
    sealed class Projection(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): Projection =
            when (this) {
                is ProjectStar -> copy(metas = metas)
                is ProjectList -> copy(metas = metas)
                is ProjectPivot -> copy(metas = metas)
                is ProjectValue -> copy(metas = metas)
            }
    
        class ProjectStar(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Projection() {
        
            override fun copy(metas: MetaContainer): ProjectStar =
                ProjectStar(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): ProjectStar =
                ProjectStar(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("project_star"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != ProjectStar::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 5000
        }
    
        class ProjectList(
            val projectItems: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Projection() {
        
            override fun copy(metas: MetaContainer): ProjectList =
                ProjectList(
                    projectItems = projectItems,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): ProjectList =
                ProjectList(
                    projectItems = projectItems,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("project_list"),
                    *projectItems.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                projectItems: kotlin.collections.List = this.projectItems,
                metas: MetaContainer = this.metas
            ) =
                ProjectList(
                    projectItems,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != ProjectList::class.java) return false
        
                other as ProjectList
                if (projectItems != other.projectItems) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = projectItems.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class ProjectPivot(
            val value: Expr,
            val key: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Projection() {
        
            override fun copy(metas: MetaContainer): ProjectPivot =
                ProjectPivot(
                    value = value,
                    key = key,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): ProjectPivot =
                ProjectPivot(
                    value = value,
                    key = key,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("project_pivot"),
                    value.toIonElement(),
                    key.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                value: Expr = this.value,
                key: Expr = this.key,
                metas: MetaContainer = this.metas
            ) =
                ProjectPivot(
                    value,
                    key,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != ProjectPivot::class.java) return false
        
                other as ProjectPivot
                if (value != other.value) return false
                if (key != other.key) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = value.hashCode()
                hc = 31 * hc + key.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class ProjectValue(
            val value: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Projection() {
        
            override fun copy(metas: MetaContainer): ProjectValue =
                ProjectValue(
                    value = value,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): ProjectValue =
                ProjectValue(
                    value = value,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("project_value"),
                    value.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                value: Expr = this.value,
                metas: MetaContainer = this.metas
            ) =
                ProjectValue(
                    value,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != ProjectValue::class.java) return false
        
                other as ProjectValue
                if (value != other.value) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = value.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlAst.Projection] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.Projection): T = when(node) {
                is PartiqlAst.Projection.ProjectStar -> convertProjectStar(node)
                is PartiqlAst.Projection.ProjectList -> convertProjectList(node)
                is PartiqlAst.Projection.ProjectPivot -> convertProjectPivot(node)
                is PartiqlAst.Projection.ProjectValue -> convertProjectValue(node)
            }
    
            fun convertProjectStar(node: PartiqlAst.Projection.ProjectStar): T
            fun convertProjectList(node: PartiqlAst.Projection.ProjectList): T
            fun convertProjectPivot(node: PartiqlAst.Projection.ProjectPivot): T
            fun convertProjectValue(node: PartiqlAst.Projection.ProjectValue): T
        }
    }
    
    sealed class ProjectItem(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): ProjectItem =
            when (this) {
                is ProjectAll -> copy(metas = metas)
                is ProjectExpr -> copy(metas = metas)
            }
    
        class ProjectAll(
            val expr: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): ProjectItem() {
        
            override fun copy(metas: MetaContainer): ProjectAll =
                ProjectAll(
                    expr = expr,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): ProjectAll =
                ProjectAll(
                    expr = expr,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("project_all"),
                    expr.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                expr: Expr = this.expr,
                metas: MetaContainer = this.metas
            ) =
                ProjectAll(
                    expr,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != ProjectAll::class.java) return false
        
                other as ProjectAll
                if (expr != other.expr) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = expr.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class ProjectExpr(
            val expr: Expr,
            val asAlias: org.partiql.pig.runtime.SymbolPrimitive?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): ProjectItem() {
        
            override fun copy(metas: MetaContainer): ProjectExpr =
                ProjectExpr(
                    expr = expr,
                    asAlias = asAlias,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): ProjectExpr =
                ProjectExpr(
                    expr = expr,
                    asAlias = asAlias,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("project_expr"),
                    expr.toIonElement(),
                    asAlias?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                expr: Expr = this.expr,
                asAlias: org.partiql.pig.runtime.SymbolPrimitive? = this.asAlias,
                metas: MetaContainer = this.metas
            ) =
                ProjectExpr(
                    expr,
                    asAlias,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != ProjectExpr::class.java) return false
        
                other as ProjectExpr
                if (expr != other.expr) return false
                if (asAlias != other.asAlias) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = expr.hashCode()
                hc = 31 * hc + asAlias.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlAst.ProjectItem] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.ProjectItem): T = when(node) {
                is PartiqlAst.ProjectItem.ProjectAll -> convertProjectAll(node)
                is PartiqlAst.ProjectItem.ProjectExpr -> convertProjectExpr(node)
            }
    
            fun convertProjectAll(node: PartiqlAst.ProjectItem.ProjectAll): T
            fun convertProjectExpr(node: PartiqlAst.ProjectItem.ProjectExpr): T
        }
    }
    
    sealed class FromSource(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): FromSource =
            when (this) {
                is Scan -> copy(metas = metas)
                is Unpivot -> copy(metas = metas)
                is Join -> copy(metas = metas)
            }
    
        class Scan(
            val expr: Expr,
            val asAlias: org.partiql.pig.runtime.SymbolPrimitive?,
            val atAlias: org.partiql.pig.runtime.SymbolPrimitive?,
            val byAlias: org.partiql.pig.runtime.SymbolPrimitive?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): FromSource() {
        
            override fun copy(metas: MetaContainer): Scan =
                Scan(
                    expr = expr,
                    asAlias = asAlias,
                    atAlias = atAlias,
                    byAlias = byAlias,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Scan =
                Scan(
                    expr = expr,
                    asAlias = asAlias,
                    atAlias = atAlias,
                    byAlias = byAlias,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("scan"),
                    expr.toIonElement(),
                    asAlias?.toIonElement() ?: ionNull(),
                    atAlias?.toIonElement() ?: ionNull(),
                    byAlias?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                expr: Expr = this.expr,
                asAlias: org.partiql.pig.runtime.SymbolPrimitive? = this.asAlias,
                atAlias: org.partiql.pig.runtime.SymbolPrimitive? = this.atAlias,
                byAlias: org.partiql.pig.runtime.SymbolPrimitive? = this.byAlias,
                metas: MetaContainer = this.metas
            ) =
                Scan(
                    expr,
                    asAlias,
                    atAlias,
                    byAlias,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Scan::class.java) return false
        
                other as Scan
                if (expr != other.expr) return false
                if (asAlias != other.asAlias) return false
                if (atAlias != other.atAlias) return false
                if (byAlias != other.byAlias) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = expr.hashCode()
                hc = 31 * hc + asAlias.hashCode()
                hc = 31 * hc + atAlias.hashCode()
                hc = 31 * hc + byAlias.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Unpivot(
            val expr: Expr,
            val asAlias: org.partiql.pig.runtime.SymbolPrimitive?,
            val atAlias: org.partiql.pig.runtime.SymbolPrimitive?,
            val byAlias: org.partiql.pig.runtime.SymbolPrimitive?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): FromSource() {
        
            override fun copy(metas: MetaContainer): Unpivot =
                Unpivot(
                    expr = expr,
                    asAlias = asAlias,
                    atAlias = atAlias,
                    byAlias = byAlias,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Unpivot =
                Unpivot(
                    expr = expr,
                    asAlias = asAlias,
                    atAlias = atAlias,
                    byAlias = byAlias,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("unpivot"),
                    expr.toIonElement(),
                    asAlias?.toIonElement() ?: ionNull(),
                    atAlias?.toIonElement() ?: ionNull(),
                    byAlias?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                expr: Expr = this.expr,
                asAlias: org.partiql.pig.runtime.SymbolPrimitive? = this.asAlias,
                atAlias: org.partiql.pig.runtime.SymbolPrimitive? = this.atAlias,
                byAlias: org.partiql.pig.runtime.SymbolPrimitive? = this.byAlias,
                metas: MetaContainer = this.metas
            ) =
                Unpivot(
                    expr,
                    asAlias,
                    atAlias,
                    byAlias,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Unpivot::class.java) return false
        
                other as Unpivot
                if (expr != other.expr) return false
                if (asAlias != other.asAlias) return false
                if (atAlias != other.atAlias) return false
                if (byAlias != other.byAlias) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = expr.hashCode()
                hc = 31 * hc + asAlias.hashCode()
                hc = 31 * hc + atAlias.hashCode()
                hc = 31 * hc + byAlias.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Join(
            val type: JoinType,
            val left: FromSource,
            val right: FromSource,
            val predicate: Expr?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): FromSource() {
        
            override fun copy(metas: MetaContainer): Join =
                Join(
                    type = type,
                    left = left,
                    right = right,
                    predicate = predicate,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Join =
                Join(
                    type = type,
                    left = left,
                    right = right,
                    predicate = predicate,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("join"),
                    type.toIonElement(),
                    left.toIonElement(),
                    right.toIonElement(),
                    predicate?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                type: JoinType = this.type,
                left: FromSource = this.left,
                right: FromSource = this.right,
                predicate: Expr? = this.predicate,
                metas: MetaContainer = this.metas
            ) =
                Join(
                    type,
                    left,
                    right,
                    predicate,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Join::class.java) return false
        
                other as Join
                if (type != other.type) return false
                if (left != other.left) return false
                if (right != other.right) return false
                if (predicate != other.predicate) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = type.hashCode()
                hc = 31 * hc + left.hashCode()
                hc = 31 * hc + right.hashCode()
                hc = 31 * hc + predicate.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlAst.FromSource] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.FromSource): T = when(node) {
                is PartiqlAst.FromSource.Scan -> convertScan(node)
                is PartiqlAst.FromSource.Unpivot -> convertUnpivot(node)
                is PartiqlAst.FromSource.Join -> convertJoin(node)
            }
    
            fun convertScan(node: PartiqlAst.FromSource.Scan): T
            fun convertUnpivot(node: PartiqlAst.FromSource.Unpivot): T
            fun convertJoin(node: PartiqlAst.FromSource.Join): T
        }
    }
    
    sealed class JoinType(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): JoinType =
            when (this) {
                is Inner -> copy(metas = metas)
                is Left -> copy(metas = metas)
                is Right -> copy(metas = metas)
                is Full -> copy(metas = metas)
            }
    
        class Inner(
            override val metas: MetaContainer = emptyMetaContainer()
        ): JoinType() {
        
            override fun copy(metas: MetaContainer): Inner =
                Inner(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Inner =
                Inner(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("inner"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Inner::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 8000
        }
    
        class Left(
            override val metas: MetaContainer = emptyMetaContainer()
        ): JoinType() {
        
            override fun copy(metas: MetaContainer): Left =
                Left(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Left =
                Left(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("left"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Left::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 8001
        }
    
        class Right(
            override val metas: MetaContainer = emptyMetaContainer()
        ): JoinType() {
        
            override fun copy(metas: MetaContainer): Right =
                Right(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Right =
                Right(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("right"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Right::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 8002
        }
    
        class Full(
            override val metas: MetaContainer = emptyMetaContainer()
        ): JoinType() {
        
            override fun copy(metas: MetaContainer): Full =
                Full(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Full =
                Full(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("full"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Full::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 8003
        }
    
        /** Converts instances of [PartiqlAst.JoinType] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.JoinType): T = when(node) {
                is PartiqlAst.JoinType.Inner -> convertInner(node)
                is PartiqlAst.JoinType.Left -> convertLeft(node)
                is PartiqlAst.JoinType.Right -> convertRight(node)
                is PartiqlAst.JoinType.Full -> convertFull(node)
            }
    
            fun convertInner(node: PartiqlAst.JoinType.Inner): T
            fun convertLeft(node: PartiqlAst.JoinType.Left): T
            fun convertRight(node: PartiqlAst.JoinType.Right): T
            fun convertFull(node: PartiqlAst.JoinType.Full): T
        }
    }
    
    sealed class GraphMatchDirection(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): GraphMatchDirection =
            when (this) {
                is EdgeLeft -> copy(metas = metas)
                is EdgeUndirected -> copy(metas = metas)
                is EdgeRight -> copy(metas = metas)
                is EdgeLeftOrUndirected -> copy(metas = metas)
                is EdgeUndirectedOrRight -> copy(metas = metas)
                is EdgeLeftOrRight -> copy(metas = metas)
                is EdgeLeftOrUndirectedOrRight -> copy(metas = metas)
            }
    
        class EdgeLeft(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchDirection() {
        
            override fun copy(metas: MetaContainer): EdgeLeft =
                EdgeLeft(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): EdgeLeft =
                EdgeLeft(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("edge_left"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != EdgeLeft::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 9000
        }
    
        class EdgeUndirected(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchDirection() {
        
            override fun copy(metas: MetaContainer): EdgeUndirected =
                EdgeUndirected(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): EdgeUndirected =
                EdgeUndirected(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("edge_undirected"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != EdgeUndirected::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 9001
        }
    
        class EdgeRight(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchDirection() {
        
            override fun copy(metas: MetaContainer): EdgeRight =
                EdgeRight(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): EdgeRight =
                EdgeRight(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("edge_right"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != EdgeRight::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 9002
        }
    
        class EdgeLeftOrUndirected(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchDirection() {
        
            override fun copy(metas: MetaContainer): EdgeLeftOrUndirected =
                EdgeLeftOrUndirected(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): EdgeLeftOrUndirected =
                EdgeLeftOrUndirected(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("edge_left_or_undirected"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != EdgeLeftOrUndirected::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 9003
        }
    
        class EdgeUndirectedOrRight(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchDirection() {
        
            override fun copy(metas: MetaContainer): EdgeUndirectedOrRight =
                EdgeUndirectedOrRight(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): EdgeUndirectedOrRight =
                EdgeUndirectedOrRight(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("edge_undirected_or_right"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != EdgeUndirectedOrRight::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 9004
        }
    
        class EdgeLeftOrRight(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchDirection() {
        
            override fun copy(metas: MetaContainer): EdgeLeftOrRight =
                EdgeLeftOrRight(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): EdgeLeftOrRight =
                EdgeLeftOrRight(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("edge_left_or_right"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != EdgeLeftOrRight::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 9005
        }
    
        class EdgeLeftOrUndirectedOrRight(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchDirection() {
        
            override fun copy(metas: MetaContainer): EdgeLeftOrUndirectedOrRight =
                EdgeLeftOrUndirectedOrRight(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): EdgeLeftOrUndirectedOrRight =
                EdgeLeftOrUndirectedOrRight(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("edge_left_or_undirected_or_right"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != EdgeLeftOrUndirectedOrRight::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 9006
        }
    
        /** Converts instances of [PartiqlAst.GraphMatchDirection] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.GraphMatchDirection): T = when(node) {
                is PartiqlAst.GraphMatchDirection.EdgeLeft -> convertEdgeLeft(node)
                is PartiqlAst.GraphMatchDirection.EdgeUndirected -> convertEdgeUndirected(node)
                is PartiqlAst.GraphMatchDirection.EdgeRight -> convertEdgeRight(node)
                is PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected -> convertEdgeLeftOrUndirected(node)
                is PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight -> convertEdgeUndirectedOrRight(node)
                is PartiqlAst.GraphMatchDirection.EdgeLeftOrRight -> convertEdgeLeftOrRight(node)
                is PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight -> convertEdgeLeftOrUndirectedOrRight(node)
            }
    
            fun convertEdgeLeft(node: PartiqlAst.GraphMatchDirection.EdgeLeft): T
            fun convertEdgeUndirected(node: PartiqlAst.GraphMatchDirection.EdgeUndirected): T
            fun convertEdgeRight(node: PartiqlAst.GraphMatchDirection.EdgeRight): T
            fun convertEdgeLeftOrUndirected(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected): T
            fun convertEdgeUndirectedOrRight(node: PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight): T
            fun convertEdgeLeftOrRight(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrRight): T
            fun convertEdgeLeftOrUndirectedOrRight(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight): T
        }
    }
    
    sealed class GraphMatchPatternPart(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): GraphMatchPatternPart =
            when (this) {
                is Node -> copy(metas = metas)
                is Edge -> copy(metas = metas)
                is Pattern -> copy(metas = metas)
            }
    
        class Node(
            val prefilter: Expr?,
            val variable: org.partiql.pig.runtime.SymbolPrimitive?,
            val label: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchPatternPart() {
        
            override fun copy(metas: MetaContainer): Node =
                Node(
                    prefilter = prefilter,
                    variable = variable,
                    label = label,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Node =
                Node(
                    prefilter = prefilter,
                    variable = variable,
                    label = label,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("node"),
                    prefilter?.toIonElement() ?: ionNull(),
                    variable?.toIonElement() ?: ionNull(),
                    *label.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                prefilter: Expr? = this.prefilter,
                variable: org.partiql.pig.runtime.SymbolPrimitive? = this.variable,
                label: kotlin.collections.List = this.label,
                metas: MetaContainer = this.metas
            ) =
                Node(
                    prefilter,
                    variable,
                    label,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Node::class.java) return false
        
                other as Node
                if (prefilter != other.prefilter) return false
                if (variable != other.variable) return false
                if (label != other.label) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = prefilter.hashCode()
                hc = 31 * hc + variable.hashCode()
                hc = 31 * hc + label.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Edge(
            val direction: GraphMatchDirection,
            val quantifier: GraphMatchQuantifier?,
            val prefilter: Expr?,
            val variable: org.partiql.pig.runtime.SymbolPrimitive?,
            val label: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchPatternPart() {
        
            override fun copy(metas: MetaContainer): Edge =
                Edge(
                    direction = direction,
                    quantifier = quantifier,
                    prefilter = prefilter,
                    variable = variable,
                    label = label,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Edge =
                Edge(
                    direction = direction,
                    quantifier = quantifier,
                    prefilter = prefilter,
                    variable = variable,
                    label = label,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("edge"),
                    direction.toIonElement(),
                    quantifier?.toIonElement() ?: ionNull(),
                    prefilter?.toIonElement() ?: ionNull(),
                    variable?.toIonElement() ?: ionNull(),
                    *label.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                direction: GraphMatchDirection = this.direction,
                quantifier: GraphMatchQuantifier? = this.quantifier,
                prefilter: Expr? = this.prefilter,
                variable: org.partiql.pig.runtime.SymbolPrimitive? = this.variable,
                label: kotlin.collections.List = this.label,
                metas: MetaContainer = this.metas
            ) =
                Edge(
                    direction,
                    quantifier,
                    prefilter,
                    variable,
                    label,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Edge::class.java) return false
        
                other as Edge
                if (direction != other.direction) return false
                if (quantifier != other.quantifier) return false
                if (prefilter != other.prefilter) return false
                if (variable != other.variable) return false
                if (label != other.label) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = direction.hashCode()
                hc = 31 * hc + quantifier.hashCode()
                hc = 31 * hc + prefilter.hashCode()
                hc = 31 * hc + variable.hashCode()
                hc = 31 * hc + label.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Pattern(
            val pattern: GraphMatchPattern,
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchPatternPart() {
        
            override fun copy(metas: MetaContainer): Pattern =
                Pattern(
                    pattern = pattern,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Pattern =
                Pattern(
                    pattern = pattern,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("pattern"),
                    pattern.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                pattern: GraphMatchPattern = this.pattern,
                metas: MetaContainer = this.metas
            ) =
                Pattern(
                    pattern,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Pattern::class.java) return false
        
                other as Pattern
                if (pattern != other.pattern) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = pattern.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlAst.GraphMatchPatternPart] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.GraphMatchPatternPart): T = when(node) {
                is PartiqlAst.GraphMatchPatternPart.Node -> convertNode(node)
                is PartiqlAst.GraphMatchPatternPart.Edge -> convertEdge(node)
                is PartiqlAst.GraphMatchPatternPart.Pattern -> convertPattern(node)
            }
    
            fun convertNode(node: PartiqlAst.GraphMatchPatternPart.Node): T
            fun convertEdge(node: PartiqlAst.GraphMatchPatternPart.Edge): T
            fun convertPattern(node: PartiqlAst.GraphMatchPatternPart.Pattern): T
        }
    }
    
    sealed class GraphMatchRestrictor(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): GraphMatchRestrictor =
            when (this) {
                is RestrictorTrail -> copy(metas = metas)
                is RestrictorAcyclic -> copy(metas = metas)
                is RestrictorSimple -> copy(metas = metas)
            }
    
        class RestrictorTrail(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchRestrictor() {
        
            override fun copy(metas: MetaContainer): RestrictorTrail =
                RestrictorTrail(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): RestrictorTrail =
                RestrictorTrail(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("restrictor_trail"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != RestrictorTrail::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 11000
        }
    
        class RestrictorAcyclic(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchRestrictor() {
        
            override fun copy(metas: MetaContainer): RestrictorAcyclic =
                RestrictorAcyclic(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): RestrictorAcyclic =
                RestrictorAcyclic(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("restrictor_acyclic"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != RestrictorAcyclic::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 11001
        }
    
        class RestrictorSimple(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchRestrictor() {
        
            override fun copy(metas: MetaContainer): RestrictorSimple =
                RestrictorSimple(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): RestrictorSimple =
                RestrictorSimple(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("restrictor_simple"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != RestrictorSimple::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 11002
        }
    
        /** Converts instances of [PartiqlAst.GraphMatchRestrictor] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.GraphMatchRestrictor): T = when(node) {
                is PartiqlAst.GraphMatchRestrictor.RestrictorTrail -> convertRestrictorTrail(node)
                is PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic -> convertRestrictorAcyclic(node)
                is PartiqlAst.GraphMatchRestrictor.RestrictorSimple -> convertRestrictorSimple(node)
            }
    
            fun convertRestrictorTrail(node: PartiqlAst.GraphMatchRestrictor.RestrictorTrail): T
            fun convertRestrictorAcyclic(node: PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic): T
            fun convertRestrictorSimple(node: PartiqlAst.GraphMatchRestrictor.RestrictorSimple): T
        }
    }
    
    sealed class GraphMatchSelector(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): GraphMatchSelector =
            when (this) {
                is SelectorAnyShortest -> copy(metas = metas)
                is SelectorAllShortest -> copy(metas = metas)
                is SelectorAny -> copy(metas = metas)
                is SelectorAnyK -> copy(metas = metas)
                is SelectorShortestK -> copy(metas = metas)
                is SelectorShortestKGroup -> copy(metas = metas)
            }
    
        class SelectorAnyShortest(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchSelector() {
        
            override fun copy(metas: MetaContainer): SelectorAnyShortest =
                SelectorAnyShortest(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): SelectorAnyShortest =
                SelectorAnyShortest(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("selector_any_shortest"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != SelectorAnyShortest::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 12000
        }
    
        class SelectorAllShortest(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchSelector() {
        
            override fun copy(metas: MetaContainer): SelectorAllShortest =
                SelectorAllShortest(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): SelectorAllShortest =
                SelectorAllShortest(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("selector_all_shortest"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != SelectorAllShortest::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 12001
        }
    
        class SelectorAny(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchSelector() {
        
            override fun copy(metas: MetaContainer): SelectorAny =
                SelectorAny(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): SelectorAny =
                SelectorAny(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("selector_any"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != SelectorAny::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 12002
        }
    
        class SelectorAnyK(
            val k: org.partiql.pig.runtime.LongPrimitive,
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchSelector() {
        
            override fun copy(metas: MetaContainer): SelectorAnyK =
                SelectorAnyK(
                    k = k,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): SelectorAnyK =
                SelectorAnyK(
                    k = k,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("selector_any_k"),
                    k.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                k: org.partiql.pig.runtime.LongPrimitive = this.k,
                metas: MetaContainer = this.metas
            ) =
                SelectorAnyK(
                    k,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != SelectorAnyK::class.java) return false
        
                other as SelectorAnyK
                if (k != other.k) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = k.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class SelectorShortestK(
            val k: org.partiql.pig.runtime.LongPrimitive,
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchSelector() {
        
            override fun copy(metas: MetaContainer): SelectorShortestK =
                SelectorShortestK(
                    k = k,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): SelectorShortestK =
                SelectorShortestK(
                    k = k,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("selector_shortest_k"),
                    k.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                k: org.partiql.pig.runtime.LongPrimitive = this.k,
                metas: MetaContainer = this.metas
            ) =
                SelectorShortestK(
                    k,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != SelectorShortestK::class.java) return false
        
                other as SelectorShortestK
                if (k != other.k) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = k.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class SelectorShortestKGroup(
            val k: org.partiql.pig.runtime.LongPrimitive,
            override val metas: MetaContainer = emptyMetaContainer()
        ): GraphMatchSelector() {
        
            override fun copy(metas: MetaContainer): SelectorShortestKGroup =
                SelectorShortestKGroup(
                    k = k,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): SelectorShortestKGroup =
                SelectorShortestKGroup(
                    k = k,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("selector_shortest_k_group"),
                    k.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                k: org.partiql.pig.runtime.LongPrimitive = this.k,
                metas: MetaContainer = this.metas
            ) =
                SelectorShortestKGroup(
                    k,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != SelectorShortestKGroup::class.java) return false
        
                other as SelectorShortestKGroup
                if (k != other.k) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = k.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlAst.GraphMatchSelector] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.GraphMatchSelector): T = when(node) {
                is PartiqlAst.GraphMatchSelector.SelectorAnyShortest -> convertSelectorAnyShortest(node)
                is PartiqlAst.GraphMatchSelector.SelectorAllShortest -> convertSelectorAllShortest(node)
                is PartiqlAst.GraphMatchSelector.SelectorAny -> convertSelectorAny(node)
                is PartiqlAst.GraphMatchSelector.SelectorAnyK -> convertSelectorAnyK(node)
                is PartiqlAst.GraphMatchSelector.SelectorShortestK -> convertSelectorShortestK(node)
                is PartiqlAst.GraphMatchSelector.SelectorShortestKGroup -> convertSelectorShortestKGroup(node)
            }
    
            fun convertSelectorAnyShortest(node: PartiqlAst.GraphMatchSelector.SelectorAnyShortest): T
            fun convertSelectorAllShortest(node: PartiqlAst.GraphMatchSelector.SelectorAllShortest): T
            fun convertSelectorAny(node: PartiqlAst.GraphMatchSelector.SelectorAny): T
            fun convertSelectorAnyK(node: PartiqlAst.GraphMatchSelector.SelectorAnyK): T
            fun convertSelectorShortestK(node: PartiqlAst.GraphMatchSelector.SelectorShortestK): T
            fun convertSelectorShortestKGroup(node: PartiqlAst.GraphMatchSelector.SelectorShortestKGroup): T
        }
    }
    
    sealed class GroupingStrategy(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): GroupingStrategy =
            when (this) {
                is GroupFull -> copy(metas = metas)
                is GroupPartial -> copy(metas = metas)
            }
    
        class GroupFull(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GroupingStrategy() {
        
            override fun copy(metas: MetaContainer): GroupFull =
                GroupFull(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): GroupFull =
                GroupFull(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("group_full"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != GroupFull::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 13000
        }
    
        class GroupPartial(
            override val metas: MetaContainer = emptyMetaContainer()
        ): GroupingStrategy() {
        
            override fun copy(metas: MetaContainer): GroupPartial =
                GroupPartial(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): GroupPartial =
                GroupPartial(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("group_partial"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != GroupPartial::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 13001
        }
    
        /** Converts instances of [PartiqlAst.GroupingStrategy] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.GroupingStrategy): T = when(node) {
                is PartiqlAst.GroupingStrategy.GroupFull -> convertGroupFull(node)
                is PartiqlAst.GroupingStrategy.GroupPartial -> convertGroupPartial(node)
            }
    
            fun convertGroupFull(node: PartiqlAst.GroupingStrategy.GroupFull): T
            fun convertGroupPartial(node: PartiqlAst.GroupingStrategy.GroupPartial): T
        }
    }
    
    sealed class OrderingSpec(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): OrderingSpec =
            when (this) {
                is Asc -> copy(metas = metas)
                is Desc -> copy(metas = metas)
            }
    
        class Asc(
            override val metas: MetaContainer = emptyMetaContainer()
        ): OrderingSpec() {
        
            override fun copy(metas: MetaContainer): Asc =
                Asc(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Asc =
                Asc(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("asc"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Asc::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 14000
        }
    
        class Desc(
            override val metas: MetaContainer = emptyMetaContainer()
        ): OrderingSpec() {
        
            override fun copy(metas: MetaContainer): Desc =
                Desc(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Desc =
                Desc(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("desc"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Desc::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 14001
        }
    
        /** Converts instances of [PartiqlAst.OrderingSpec] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.OrderingSpec): T = when(node) {
                is PartiqlAst.OrderingSpec.Asc -> convertAsc(node)
                is PartiqlAst.OrderingSpec.Desc -> convertDesc(node)
            }
    
            fun convertAsc(node: PartiqlAst.OrderingSpec.Asc): T
            fun convertDesc(node: PartiqlAst.OrderingSpec.Desc): T
        }
    }
    
    sealed class NullsSpec(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): NullsSpec =
            when (this) {
                is NullsFirst -> copy(metas = metas)
                is NullsLast -> copy(metas = metas)
            }
    
        class NullsFirst(
            override val metas: MetaContainer = emptyMetaContainer()
        ): NullsSpec() {
        
            override fun copy(metas: MetaContainer): NullsFirst =
                NullsFirst(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): NullsFirst =
                NullsFirst(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("nulls_first"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != NullsFirst::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 15000
        }
    
        class NullsLast(
            override val metas: MetaContainer = emptyMetaContainer()
        ): NullsSpec() {
        
            override fun copy(metas: MetaContainer): NullsLast =
                NullsLast(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): NullsLast =
                NullsLast(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("nulls_last"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != NullsLast::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 15001
        }
    
        /** Converts instances of [PartiqlAst.NullsSpec] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.NullsSpec): T = when(node) {
                is PartiqlAst.NullsSpec.NullsFirst -> convertNullsFirst(node)
                is PartiqlAst.NullsSpec.NullsLast -> convertNullsLast(node)
            }
    
            fun convertNullsFirst(node: PartiqlAst.NullsSpec.NullsFirst): T
            fun convertNullsLast(node: PartiqlAst.NullsSpec.NullsLast): T
        }
    }
    
    sealed class CaseSensitivity(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): CaseSensitivity =
            when (this) {
                is CaseSensitive -> copy(metas = metas)
                is CaseInsensitive -> copy(metas = metas)
            }
    
        class CaseSensitive(
            override val metas: MetaContainer = emptyMetaContainer()
        ): CaseSensitivity() {
        
            override fun copy(metas: MetaContainer): CaseSensitive =
                CaseSensitive(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): CaseSensitive =
                CaseSensitive(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("case_sensitive"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != CaseSensitive::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 16000
        }
    
        class CaseInsensitive(
            override val metas: MetaContainer = emptyMetaContainer()
        ): CaseSensitivity() {
        
            override fun copy(metas: MetaContainer): CaseInsensitive =
                CaseInsensitive(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): CaseInsensitive =
                CaseInsensitive(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("case_insensitive"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != CaseInsensitive::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 16001
        }
    
        /** Converts instances of [PartiqlAst.CaseSensitivity] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.CaseSensitivity): T = when(node) {
                is PartiqlAst.CaseSensitivity.CaseSensitive -> convertCaseSensitive(node)
                is PartiqlAst.CaseSensitivity.CaseInsensitive -> convertCaseInsensitive(node)
            }
    
            fun convertCaseSensitive(node: PartiqlAst.CaseSensitivity.CaseSensitive): T
            fun convertCaseInsensitive(node: PartiqlAst.CaseSensitivity.CaseInsensitive): T
        }
    }
    
    sealed class ScopeQualifier(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): ScopeQualifier =
            when (this) {
                is Unqualified -> copy(metas = metas)
                is LocalsFirst -> copy(metas = metas)
            }
    
        class Unqualified(
            override val metas: MetaContainer = emptyMetaContainer()
        ): ScopeQualifier() {
        
            override fun copy(metas: MetaContainer): Unqualified =
                Unqualified(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Unqualified =
                Unqualified(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("unqualified"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Unqualified::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 17000
        }
    
        class LocalsFirst(
            override val metas: MetaContainer = emptyMetaContainer()
        ): ScopeQualifier() {
        
            override fun copy(metas: MetaContainer): LocalsFirst =
                LocalsFirst(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): LocalsFirst =
                LocalsFirst(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("locals_first"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != LocalsFirst::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 17001
        }
    
        /** Converts instances of [PartiqlAst.ScopeQualifier] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.ScopeQualifier): T = when(node) {
                is PartiqlAst.ScopeQualifier.Unqualified -> convertUnqualified(node)
                is PartiqlAst.ScopeQualifier.LocalsFirst -> convertLocalsFirst(node)
            }
    
            fun convertUnqualified(node: PartiqlAst.ScopeQualifier.Unqualified): T
            fun convertLocalsFirst(node: PartiqlAst.ScopeQualifier.LocalsFirst): T
        }
    }
    
    sealed class SetQuantifier(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): SetQuantifier =
            when (this) {
                is All -> copy(metas = metas)
                is Distinct -> copy(metas = metas)
            }
    
        class All(
            override val metas: MetaContainer = emptyMetaContainer()
        ): SetQuantifier() {
        
            override fun copy(metas: MetaContainer): All =
                All(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): All =
                All(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("all"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != All::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 18000
        }
    
        class Distinct(
            override val metas: MetaContainer = emptyMetaContainer()
        ): SetQuantifier() {
        
            override fun copy(metas: MetaContainer): Distinct =
                Distinct(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Distinct =
                Distinct(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("distinct"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Distinct::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 18001
        }
    
        /** Converts instances of [PartiqlAst.SetQuantifier] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.SetQuantifier): T = when(node) {
                is PartiqlAst.SetQuantifier.All -> convertAll(node)
                is PartiqlAst.SetQuantifier.Distinct -> convertDistinct(node)
            }
    
            fun convertAll(node: PartiqlAst.SetQuantifier.All): T
            fun convertDistinct(node: PartiqlAst.SetQuantifier.Distinct): T
        }
    }
    
    sealed class BagOpType(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): BagOpType =
            when (this) {
                is Union -> copy(metas = metas)
                is Intersect -> copy(metas = metas)
                is Except -> copy(metas = metas)
                is OuterUnion -> copy(metas = metas)
                is OuterIntersect -> copy(metas = metas)
                is OuterExcept -> copy(metas = metas)
            }
    
        class Union(
            override val metas: MetaContainer = emptyMetaContainer()
        ): BagOpType() {
        
            override fun copy(metas: MetaContainer): Union =
                Union(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Union =
                Union(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("union"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Union::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 19000
        }
    
        class Intersect(
            override val metas: MetaContainer = emptyMetaContainer()
        ): BagOpType() {
        
            override fun copy(metas: MetaContainer): Intersect =
                Intersect(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Intersect =
                Intersect(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("intersect"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Intersect::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 19001
        }
    
        class Except(
            override val metas: MetaContainer = emptyMetaContainer()
        ): BagOpType() {
        
            override fun copy(metas: MetaContainer): Except =
                Except(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Except =
                Except(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("except"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Except::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 19002
        }
    
        class OuterUnion(
            override val metas: MetaContainer = emptyMetaContainer()
        ): BagOpType() {
        
            override fun copy(metas: MetaContainer): OuterUnion =
                OuterUnion(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): OuterUnion =
                OuterUnion(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("outer_union"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != OuterUnion::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 19003
        }
    
        class OuterIntersect(
            override val metas: MetaContainer = emptyMetaContainer()
        ): BagOpType() {
        
            override fun copy(metas: MetaContainer): OuterIntersect =
                OuterIntersect(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): OuterIntersect =
                OuterIntersect(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("outer_intersect"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != OuterIntersect::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 19004
        }
    
        class OuterExcept(
            override val metas: MetaContainer = emptyMetaContainer()
        ): BagOpType() {
        
            override fun copy(metas: MetaContainer): OuterExcept =
                OuterExcept(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): OuterExcept =
                OuterExcept(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("outer_except"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != OuterExcept::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 19005
        }
    
        /** Converts instances of [PartiqlAst.BagOpType] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.BagOpType): T = when(node) {
                is PartiqlAst.BagOpType.Union -> convertUnion(node)
                is PartiqlAst.BagOpType.Intersect -> convertIntersect(node)
                is PartiqlAst.BagOpType.Except -> convertExcept(node)
                is PartiqlAst.BagOpType.OuterUnion -> convertOuterUnion(node)
                is PartiqlAst.BagOpType.OuterIntersect -> convertOuterIntersect(node)
                is PartiqlAst.BagOpType.OuterExcept -> convertOuterExcept(node)
            }
    
            fun convertUnion(node: PartiqlAst.BagOpType.Union): T
            fun convertIntersect(node: PartiqlAst.BagOpType.Intersect): T
            fun convertExcept(node: PartiqlAst.BagOpType.Except): T
            fun convertOuterUnion(node: PartiqlAst.BagOpType.OuterUnion): T
            fun convertOuterIntersect(node: PartiqlAst.BagOpType.OuterIntersect): T
            fun convertOuterExcept(node: PartiqlAst.BagOpType.OuterExcept): T
        }
    }
    
    sealed class DmlOp(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): DmlOp =
            when (this) {
                is Insert -> copy(metas = metas)
                is InsertValue -> copy(metas = metas)
                is Set -> copy(metas = metas)
                is Remove -> copy(metas = metas)
                is Delete -> copy(metas = metas)
            }
    
        class Insert(
            val target: Expr,
            val values: Expr,
            val conflictAction: ConflictAction?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): DmlOp() {
        
            override fun copy(metas: MetaContainer): Insert =
                Insert(
                    target = target,
                    values = values,
                    conflictAction = conflictAction,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Insert =
                Insert(
                    target = target,
                    values = values,
                    conflictAction = conflictAction,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("insert"),
                    target.toIonElement(),
                    values.toIonElement(),
                    conflictAction?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                target: Expr = this.target,
                values: Expr = this.values,
                conflictAction: ConflictAction? = this.conflictAction,
                metas: MetaContainer = this.metas
            ) =
                Insert(
                    target,
                    values,
                    conflictAction,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Insert::class.java) return false
        
                other as Insert
                if (target != other.target) return false
                if (values != other.values) return false
                if (conflictAction != other.conflictAction) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = target.hashCode()
                hc = 31 * hc + values.hashCode()
                hc = 31 * hc + conflictAction.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class InsertValue(
            val target: Expr,
            val value: Expr,
            val index: Expr?,
            val onConflict: OnConflict?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): DmlOp() {
        
            override fun copy(metas: MetaContainer): InsertValue =
                InsertValue(
                    target = target,
                    value = value,
                    index = index,
                    onConflict = onConflict,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): InsertValue =
                InsertValue(
                    target = target,
                    value = value,
                    index = index,
                    onConflict = onConflict,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("insert_value"),
                    target.toIonElement(),
                    value.toIonElement(),
                    index?.toIonElement() ?: ionNull(),
                    onConflict?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                target: Expr = this.target,
                value: Expr = this.value,
                index: Expr? = this.index,
                onConflict: OnConflict? = this.onConflict,
                metas: MetaContainer = this.metas
            ) =
                InsertValue(
                    target,
                    value,
                    index,
                    onConflict,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != InsertValue::class.java) return false
        
                other as InsertValue
                if (target != other.target) return false
                if (value != other.value) return false
                if (index != other.index) return false
                if (onConflict != other.onConflict) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = target.hashCode()
                hc = 31 * hc + value.hashCode()
                hc = 31 * hc + index.hashCode()
                hc = 31 * hc + onConflict.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Set(
            val assignment: Assignment,
            override val metas: MetaContainer = emptyMetaContainer()
        ): DmlOp() {
        
            override fun copy(metas: MetaContainer): Set =
                Set(
                    assignment = assignment,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Set =
                Set(
                    assignment = assignment,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("set"),
                    assignment.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                assignment: Assignment = this.assignment,
                metas: MetaContainer = this.metas
            ) =
                Set(
                    assignment,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Set::class.java) return false
        
                other as Set
                if (assignment != other.assignment) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = assignment.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Remove(
            val target: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): DmlOp() {
        
            override fun copy(metas: MetaContainer): Remove =
                Remove(
                    target = target,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Remove =
                Remove(
                    target = target,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("remove"),
                    target.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                target: Expr = this.target,
                metas: MetaContainer = this.metas
            ) =
                Remove(
                    target,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Remove::class.java) return false
        
                other as Remove
                if (target != other.target) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = target.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Delete(
            override val metas: MetaContainer = emptyMetaContainer()
        ): DmlOp() {
        
            override fun copy(metas: MetaContainer): Delete =
                Delete(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Delete =
                Delete(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("delete"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Delete::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 20004
        }
    
        /** Converts instances of [PartiqlAst.DmlOp] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.DmlOp): T = when(node) {
                is PartiqlAst.DmlOp.Insert -> convertInsert(node)
                is PartiqlAst.DmlOp.InsertValue -> convertInsertValue(node)
                is PartiqlAst.DmlOp.Set -> convertSet(node)
                is PartiqlAst.DmlOp.Remove -> convertRemove(node)
                is PartiqlAst.DmlOp.Delete -> convertDelete(node)
            }
    
            fun convertInsert(node: PartiqlAst.DmlOp.Insert): T
            fun convertInsertValue(node: PartiqlAst.DmlOp.InsertValue): T
            fun convertSet(node: PartiqlAst.DmlOp.Set): T
            fun convertRemove(node: PartiqlAst.DmlOp.Remove): T
            fun convertDelete(node: PartiqlAst.DmlOp.Delete): T
        }
    }
    
    sealed class ConflictAction(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): ConflictAction =
            when (this) {
                is DoReplace -> copy(metas = metas)
                is DoUpdate -> copy(metas = metas)
                is DoNothing -> copy(metas = metas)
            }
    
        class DoReplace(
            val value: OnConflictValue,
            override val metas: MetaContainer = emptyMetaContainer()
        ): ConflictAction() {
        
            override fun copy(metas: MetaContainer): DoReplace =
                DoReplace(
                    value = value,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): DoReplace =
                DoReplace(
                    value = value,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("do_replace"),
                    value.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                value: OnConflictValue = this.value,
                metas: MetaContainer = this.metas
            ) =
                DoReplace(
                    value,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != DoReplace::class.java) return false
        
                other as DoReplace
                if (value != other.value) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = value.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class DoUpdate(
            val value: OnConflictValue,
            override val metas: MetaContainer = emptyMetaContainer()
        ): ConflictAction() {
        
            override fun copy(metas: MetaContainer): DoUpdate =
                DoUpdate(
                    value = value,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): DoUpdate =
                DoUpdate(
                    value = value,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("do_update"),
                    value.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                value: OnConflictValue = this.value,
                metas: MetaContainer = this.metas
            ) =
                DoUpdate(
                    value,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != DoUpdate::class.java) return false
        
                other as DoUpdate
                if (value != other.value) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = value.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class DoNothing(
            override val metas: MetaContainer = emptyMetaContainer()
        ): ConflictAction() {
        
            override fun copy(metas: MetaContainer): DoNothing =
                DoNothing(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): DoNothing =
                DoNothing(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("do_nothing"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != DoNothing::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 21002
        }
    
        /** Converts instances of [PartiqlAst.ConflictAction] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.ConflictAction): T = when(node) {
                is PartiqlAst.ConflictAction.DoReplace -> convertDoReplace(node)
                is PartiqlAst.ConflictAction.DoUpdate -> convertDoUpdate(node)
                is PartiqlAst.ConflictAction.DoNothing -> convertDoNothing(node)
            }
    
            fun convertDoReplace(node: PartiqlAst.ConflictAction.DoReplace): T
            fun convertDoUpdate(node: PartiqlAst.ConflictAction.DoUpdate): T
            fun convertDoNothing(node: PartiqlAst.ConflictAction.DoNothing): T
        }
    }
    
    sealed class OnConflictValue(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): OnConflictValue =
            when (this) {
                is Excluded -> copy(metas = metas)
            }
    
        class Excluded(
            override val metas: MetaContainer = emptyMetaContainer()
        ): OnConflictValue() {
        
            override fun copy(metas: MetaContainer): Excluded =
                Excluded(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Excluded =
                Excluded(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("excluded"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Excluded::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 22000
        }
    
        /** Converts instances of [PartiqlAst.OnConflictValue] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.OnConflictValue): T = when(node) {
                is PartiqlAst.OnConflictValue.Excluded -> convertExcluded(node)
            }
    
            fun convertExcluded(node: PartiqlAst.OnConflictValue.Excluded): T
        }
    }
    
    sealed class DdlOp(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): DdlOp =
            when (this) {
                is CreateTable -> copy(metas = metas)
                is DropTable -> copy(metas = metas)
                is CreateIndex -> copy(metas = metas)
                is DropIndex -> copy(metas = metas)
            }
    
        class CreateTable(
            val tableName: org.partiql.pig.runtime.SymbolPrimitive,
            override val metas: MetaContainer = emptyMetaContainer()
        ): DdlOp() {
        
            override fun copy(metas: MetaContainer): CreateTable =
                CreateTable(
                    tableName = tableName,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): CreateTable =
                CreateTable(
                    tableName = tableName,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("create_table"),
                    tableName.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                tableName: org.partiql.pig.runtime.SymbolPrimitive = this.tableName,
                metas: MetaContainer = this.metas
            ) =
                CreateTable(
                    tableName,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != CreateTable::class.java) return false
        
                other as CreateTable
                if (tableName != other.tableName) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = tableName.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class DropTable(
            val tableName: Identifier,
            override val metas: MetaContainer = emptyMetaContainer()
        ): DdlOp() {
        
            override fun copy(metas: MetaContainer): DropTable =
                DropTable(
                    tableName = tableName,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): DropTable =
                DropTable(
                    tableName = tableName,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("drop_table"),
                    tableName.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                tableName: Identifier = this.tableName,
                metas: MetaContainer = this.metas
            ) =
                DropTable(
                    tableName,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != DropTable::class.java) return false
        
                other as DropTable
                if (tableName != other.tableName) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = tableName.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class CreateIndex(
            val indexName: Identifier,
            val fields: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): DdlOp() {
        
            override fun copy(metas: MetaContainer): CreateIndex =
                CreateIndex(
                    indexName = indexName,
                    fields = fields,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): CreateIndex =
                CreateIndex(
                    indexName = indexName,
                    fields = fields,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("create_index"),
                    indexName.toIonElement(),
                    *fields.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                indexName: Identifier = this.indexName,
                fields: kotlin.collections.List = this.fields,
                metas: MetaContainer = this.metas
            ) =
                CreateIndex(
                    indexName,
                    fields,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != CreateIndex::class.java) return false
        
                other as CreateIndex
                if (indexName != other.indexName) return false
                if (fields != other.fields) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = indexName.hashCode()
                hc = 31 * hc + fields.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class DropIndex(
            val table: Identifier,
            val keys: Identifier,
            override val metas: MetaContainer = emptyMetaContainer()
        ): DdlOp() {
        
            override fun copy(metas: MetaContainer): DropIndex =
                DropIndex(
                    table = table,
                    keys = keys,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): DropIndex =
                DropIndex(
                    table = table,
                    keys = keys,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = listOfNotNull(
                    ionSymbol("drop_index"),
                    table?.let { ionSexpOf(ionSymbol("table"), it.toIonElement()) },
                    keys?.let { ionSexpOf(ionSymbol("keys"), it.toIonElement()) }
                )
        
                return ionSexpOf(elements, metas = metas)
            }
        
            fun copy(
                table: Identifier = this.table,
                keys: Identifier = this.keys,
                metas: MetaContainer = this.metas
            ) =
                DropIndex(
                    table,
                    keys,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != DropIndex::class.java) return false
        
                other as DropIndex
                if (table != other.table) return false
                if (keys != other.keys) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = table.hashCode()
                hc = 31 * hc + keys.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlAst.DdlOp] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.DdlOp): T = when(node) {
                is PartiqlAst.DdlOp.CreateTable -> convertCreateTable(node)
                is PartiqlAst.DdlOp.DropTable -> convertDropTable(node)
                is PartiqlAst.DdlOp.CreateIndex -> convertCreateIndex(node)
                is PartiqlAst.DdlOp.DropIndex -> convertDropIndex(node)
            }
    
            fun convertCreateTable(node: PartiqlAst.DdlOp.CreateTable): T
            fun convertDropTable(node: PartiqlAst.DdlOp.DropTable): T
            fun convertCreateIndex(node: PartiqlAst.DdlOp.CreateIndex): T
            fun convertDropIndex(node: PartiqlAst.DdlOp.DropIndex): T
        }
    }
    
    sealed class ColumnComponent(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): ColumnComponent =
            when (this) {
                is ReturningWildcard -> copy(metas = metas)
                is ReturningColumn -> copy(metas = metas)
            }
    
        class ReturningWildcard(
            override val metas: MetaContainer = emptyMetaContainer()
        ): ColumnComponent() {
        
            override fun copy(metas: MetaContainer): ReturningWildcard =
                ReturningWildcard(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): ReturningWildcard =
                ReturningWildcard(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("returning_wildcard"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != ReturningWildcard::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 24000
        }
    
        class ReturningColumn(
            val expr: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): ColumnComponent() {
        
            override fun copy(metas: MetaContainer): ReturningColumn =
                ReturningColumn(
                    expr = expr,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): ReturningColumn =
                ReturningColumn(
                    expr = expr,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("returning_column"),
                    expr.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                expr: Expr = this.expr,
                metas: MetaContainer = this.metas
            ) =
                ReturningColumn(
                    expr,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != ReturningColumn::class.java) return false
        
                other as ReturningColumn
                if (expr != other.expr) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = expr.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlAst.ColumnComponent] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.ColumnComponent): T = when(node) {
                is PartiqlAst.ColumnComponent.ReturningWildcard -> convertReturningWildcard(node)
                is PartiqlAst.ColumnComponent.ReturningColumn -> convertReturningColumn(node)
            }
    
            fun convertReturningWildcard(node: PartiqlAst.ColumnComponent.ReturningWildcard): T
            fun convertReturningColumn(node: PartiqlAst.ColumnComponent.ReturningColumn): T
        }
    }
    
    sealed class ReturningMapping(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): ReturningMapping =
            when (this) {
                is ModifiedNew -> copy(metas = metas)
                is ModifiedOld -> copy(metas = metas)
                is AllNew -> copy(metas = metas)
                is AllOld -> copy(metas = metas)
            }
    
        class ModifiedNew(
            override val metas: MetaContainer = emptyMetaContainer()
        ): ReturningMapping() {
        
            override fun copy(metas: MetaContainer): ModifiedNew =
                ModifiedNew(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): ModifiedNew =
                ModifiedNew(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("modified_new"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != ModifiedNew::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 25000
        }
    
        class ModifiedOld(
            override val metas: MetaContainer = emptyMetaContainer()
        ): ReturningMapping() {
        
            override fun copy(metas: MetaContainer): ModifiedOld =
                ModifiedOld(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): ModifiedOld =
                ModifiedOld(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("modified_old"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != ModifiedOld::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 25001
        }
    
        class AllNew(
            override val metas: MetaContainer = emptyMetaContainer()
        ): ReturningMapping() {
        
            override fun copy(metas: MetaContainer): AllNew =
                AllNew(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): AllNew =
                AllNew(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("all_new"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != AllNew::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 25002
        }
    
        class AllOld(
            override val metas: MetaContainer = emptyMetaContainer()
        ): ReturningMapping() {
        
            override fun copy(metas: MetaContainer): AllOld =
                AllOld(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): AllOld =
                AllOld(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("all_old"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != AllOld::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 25003
        }
    
        /** Converts instances of [PartiqlAst.ReturningMapping] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.ReturningMapping): T = when(node) {
                is PartiqlAst.ReturningMapping.ModifiedNew -> convertModifiedNew(node)
                is PartiqlAst.ReturningMapping.ModifiedOld -> convertModifiedOld(node)
                is PartiqlAst.ReturningMapping.AllNew -> convertAllNew(node)
                is PartiqlAst.ReturningMapping.AllOld -> convertAllOld(node)
            }
    
            fun convertModifiedNew(node: PartiqlAst.ReturningMapping.ModifiedNew): T
            fun convertModifiedOld(node: PartiqlAst.ReturningMapping.ModifiedOld): T
            fun convertAllNew(node: PartiqlAst.ReturningMapping.AllNew): T
            fun convertAllOld(node: PartiqlAst.ReturningMapping.AllOld): T
        }
    }
    
    sealed class Type(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlAstNode() {
        override fun copy(metas: MetaContainer): Type =
            when (this) {
                is NullType -> copy(metas = metas)
                is BooleanType -> copy(metas = metas)
                is SmallintType -> copy(metas = metas)
                is Integer4Type -> copy(metas = metas)
                is Integer8Type -> copy(metas = metas)
                is IntegerType -> copy(metas = metas)
                is FloatType -> copy(metas = metas)
                is RealType -> copy(metas = metas)
                is DoublePrecisionType -> copy(metas = metas)
                is DecimalType -> copy(metas = metas)
                is NumericType -> copy(metas = metas)
                is TimestampType -> copy(metas = metas)
                is CharacterType -> copy(metas = metas)
                is CharacterVaryingType -> copy(metas = metas)
                is MissingType -> copy(metas = metas)
                is StringType -> copy(metas = metas)
                is SymbolType -> copy(metas = metas)
                is BlobType -> copy(metas = metas)
                is ClobType -> copy(metas = metas)
                is DateType -> copy(metas = metas)
                is TimeType -> copy(metas = metas)
                is TimeWithTimeZoneType -> copy(metas = metas)
                is StructType -> copy(metas = metas)
                is TupleType -> copy(metas = metas)
                is ListType -> copy(metas = metas)
                is SexpType -> copy(metas = metas)
                is BagType -> copy(metas = metas)
                is AnyType -> copy(metas = metas)
                is CustomType -> copy(metas = metas)
            }
    
        class NullType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): NullType =
                NullType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): NullType =
                NullType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("null_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != NullType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26000
        }
    
        class BooleanType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): BooleanType =
                BooleanType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): BooleanType =
                BooleanType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("boolean_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != BooleanType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26001
        }
    
        class SmallintType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): SmallintType =
                SmallintType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): SmallintType =
                SmallintType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("smallint_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != SmallintType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26002
        }
    
        class Integer4Type(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): Integer4Type =
                Integer4Type(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Integer4Type =
                Integer4Type(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("integer4_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Integer4Type::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26003
        }
    
        class Integer8Type(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): Integer8Type =
                Integer8Type(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Integer8Type =
                Integer8Type(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("integer8_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Integer8Type::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26004
        }
    
        class IntegerType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): IntegerType =
                IntegerType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): IntegerType =
                IntegerType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("integer_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != IntegerType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26005
        }
    
        class FloatType(
            val precision: org.partiql.pig.runtime.LongPrimitive?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): FloatType =
                FloatType(
                    precision = precision,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): FloatType =
                FloatType(
                    precision = precision,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("float_type"),
                    precision?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                precision: org.partiql.pig.runtime.LongPrimitive? = this.precision,
                metas: MetaContainer = this.metas
            ) =
                FloatType(
                    precision,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != FloatType::class.java) return false
        
                other as FloatType
                if (precision != other.precision) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = precision.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class RealType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): RealType =
                RealType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): RealType =
                RealType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("real_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != RealType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26007
        }
    
        class DoublePrecisionType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): DoublePrecisionType =
                DoublePrecisionType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): DoublePrecisionType =
                DoublePrecisionType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("double_precision_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != DoublePrecisionType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26008
        }
    
        class DecimalType(
            val precision: org.partiql.pig.runtime.LongPrimitive?,
            val scale: org.partiql.pig.runtime.LongPrimitive?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): DecimalType =
                DecimalType(
                    precision = precision,
                    scale = scale,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): DecimalType =
                DecimalType(
                    precision = precision,
                    scale = scale,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("decimal_type"),
                    precision?.toIonElement() ?: ionNull(),
                    scale?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                precision: org.partiql.pig.runtime.LongPrimitive? = this.precision,
                scale: org.partiql.pig.runtime.LongPrimitive? = this.scale,
                metas: MetaContainer = this.metas
            ) =
                DecimalType(
                    precision,
                    scale,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != DecimalType::class.java) return false
        
                other as DecimalType
                if (precision != other.precision) return false
                if (scale != other.scale) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = precision.hashCode()
                hc = 31 * hc + scale.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class NumericType(
            val precision: org.partiql.pig.runtime.LongPrimitive?,
            val scale: org.partiql.pig.runtime.LongPrimitive?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): NumericType =
                NumericType(
                    precision = precision,
                    scale = scale,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): NumericType =
                NumericType(
                    precision = precision,
                    scale = scale,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("numeric_type"),
                    precision?.toIonElement() ?: ionNull(),
                    scale?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                precision: org.partiql.pig.runtime.LongPrimitive? = this.precision,
                scale: org.partiql.pig.runtime.LongPrimitive? = this.scale,
                metas: MetaContainer = this.metas
            ) =
                NumericType(
                    precision,
                    scale,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != NumericType::class.java) return false
        
                other as NumericType
                if (precision != other.precision) return false
                if (scale != other.scale) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = precision.hashCode()
                hc = 31 * hc + scale.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class TimestampType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): TimestampType =
                TimestampType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): TimestampType =
                TimestampType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("timestamp_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != TimestampType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26011
        }
    
        class CharacterType(
            val length: org.partiql.pig.runtime.LongPrimitive?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): CharacterType =
                CharacterType(
                    length = length,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): CharacterType =
                CharacterType(
                    length = length,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("character_type"),
                    length?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                length: org.partiql.pig.runtime.LongPrimitive? = this.length,
                metas: MetaContainer = this.metas
            ) =
                CharacterType(
                    length,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != CharacterType::class.java) return false
        
                other as CharacterType
                if (length != other.length) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = length.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class CharacterVaryingType(
            val length: org.partiql.pig.runtime.LongPrimitive?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): CharacterVaryingType =
                CharacterVaryingType(
                    length = length,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): CharacterVaryingType =
                CharacterVaryingType(
                    length = length,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("character_varying_type"),
                    length?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                length: org.partiql.pig.runtime.LongPrimitive? = this.length,
                metas: MetaContainer = this.metas
            ) =
                CharacterVaryingType(
                    length,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != CharacterVaryingType::class.java) return false
        
                other as CharacterVaryingType
                if (length != other.length) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = length.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class MissingType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): MissingType =
                MissingType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): MissingType =
                MissingType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("missing_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != MissingType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26014
        }
    
        class StringType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): StringType =
                StringType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): StringType =
                StringType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("string_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != StringType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26015
        }
    
        class SymbolType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): SymbolType =
                SymbolType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): SymbolType =
                SymbolType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("symbol_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != SymbolType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26016
        }
    
        class BlobType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): BlobType =
                BlobType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): BlobType =
                BlobType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("blob_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != BlobType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26017
        }
    
        class ClobType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): ClobType =
                ClobType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): ClobType =
                ClobType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("clob_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != ClobType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26018
        }
    
        class DateType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): DateType =
                DateType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): DateType =
                DateType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("date_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != DateType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26019
        }
    
        class TimeType(
            val precision: org.partiql.pig.runtime.LongPrimitive?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): TimeType =
                TimeType(
                    precision = precision,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): TimeType =
                TimeType(
                    precision = precision,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("time_type"),
                    precision?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                precision: org.partiql.pig.runtime.LongPrimitive? = this.precision,
                metas: MetaContainer = this.metas
            ) =
                TimeType(
                    precision,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != TimeType::class.java) return false
        
                other as TimeType
                if (precision != other.precision) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = precision.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class TimeWithTimeZoneType(
            val precision: org.partiql.pig.runtime.LongPrimitive?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): TimeWithTimeZoneType =
                TimeWithTimeZoneType(
                    precision = precision,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): TimeWithTimeZoneType =
                TimeWithTimeZoneType(
                    precision = precision,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("time_with_time_zone_type"),
                    precision?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                precision: org.partiql.pig.runtime.LongPrimitive? = this.precision,
                metas: MetaContainer = this.metas
            ) =
                TimeWithTimeZoneType(
                    precision,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != TimeWithTimeZoneType::class.java) return false
        
                other as TimeWithTimeZoneType
                if (precision != other.precision) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = precision.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class StructType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): StructType =
                StructType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): StructType =
                StructType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("struct_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != StructType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26022
        }
    
        class TupleType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): TupleType =
                TupleType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): TupleType =
                TupleType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("tuple_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != TupleType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26023
        }
    
        class ListType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): ListType =
                ListType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): ListType =
                ListType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("list_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != ListType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26024
        }
    
        class SexpType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): SexpType =
                SexpType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): SexpType =
                SexpType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("sexp_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != SexpType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26025
        }
    
        class BagType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): BagType =
                BagType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): BagType =
                BagType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("bag_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != BagType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26026
        }
    
        class AnyType(
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): AnyType =
                AnyType(
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): AnyType =
                AnyType(
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("any_type"),
                    metas = metas)
                return elements
            }
        
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != AnyType::class.java) return false
        
                return true
            }
        
            override fun hashCode(): Int = 26027
        }
    
        class CustomType(
            val name: org.partiql.pig.runtime.SymbolPrimitive,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Type() {
        
            override fun copy(metas: MetaContainer): CustomType =
                CustomType(
                    name = name,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): CustomType =
                CustomType(
                    name = name,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("custom_type"),
                    name.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                name: org.partiql.pig.runtime.SymbolPrimitive = this.name,
                metas: MetaContainer = this.metas
            ) =
                CustomType(
                    name,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != CustomType::class.java) return false
        
                other as CustomType
                if (name != other.name) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = name.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlAst.Type] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlAst.Type): T = when(node) {
                is PartiqlAst.Type.NullType -> convertNullType(node)
                is PartiqlAst.Type.BooleanType -> convertBooleanType(node)
                is PartiqlAst.Type.SmallintType -> convertSmallintType(node)
                is PartiqlAst.Type.Integer4Type -> convertInteger4Type(node)
                is PartiqlAst.Type.Integer8Type -> convertInteger8Type(node)
                is PartiqlAst.Type.IntegerType -> convertIntegerType(node)
                is PartiqlAst.Type.FloatType -> convertFloatType(node)
                is PartiqlAst.Type.RealType -> convertRealType(node)
                is PartiqlAst.Type.DoublePrecisionType -> convertDoublePrecisionType(node)
                is PartiqlAst.Type.DecimalType -> convertDecimalType(node)
                is PartiqlAst.Type.NumericType -> convertNumericType(node)
                is PartiqlAst.Type.TimestampType -> convertTimestampType(node)
                is PartiqlAst.Type.CharacterType -> convertCharacterType(node)
                is PartiqlAst.Type.CharacterVaryingType -> convertCharacterVaryingType(node)
                is PartiqlAst.Type.MissingType -> convertMissingType(node)
                is PartiqlAst.Type.StringType -> convertStringType(node)
                is PartiqlAst.Type.SymbolType -> convertSymbolType(node)
                is PartiqlAst.Type.BlobType -> convertBlobType(node)
                is PartiqlAst.Type.ClobType -> convertClobType(node)
                is PartiqlAst.Type.DateType -> convertDateType(node)
                is PartiqlAst.Type.TimeType -> convertTimeType(node)
                is PartiqlAst.Type.TimeWithTimeZoneType -> convertTimeWithTimeZoneType(node)
                is PartiqlAst.Type.StructType -> convertStructType(node)
                is PartiqlAst.Type.TupleType -> convertTupleType(node)
                is PartiqlAst.Type.ListType -> convertListType(node)
                is PartiqlAst.Type.SexpType -> convertSexpType(node)
                is PartiqlAst.Type.BagType -> convertBagType(node)
                is PartiqlAst.Type.AnyType -> convertAnyType(node)
                is PartiqlAst.Type.CustomType -> convertCustomType(node)
            }
    
            fun convertNullType(node: PartiqlAst.Type.NullType): T
            fun convertBooleanType(node: PartiqlAst.Type.BooleanType): T
            fun convertSmallintType(node: PartiqlAst.Type.SmallintType): T
            fun convertInteger4Type(node: PartiqlAst.Type.Integer4Type): T
            fun convertInteger8Type(node: PartiqlAst.Type.Integer8Type): T
            fun convertIntegerType(node: PartiqlAst.Type.IntegerType): T
            fun convertFloatType(node: PartiqlAst.Type.FloatType): T
            fun convertRealType(node: PartiqlAst.Type.RealType): T
            fun convertDoublePrecisionType(node: PartiqlAst.Type.DoublePrecisionType): T
            fun convertDecimalType(node: PartiqlAst.Type.DecimalType): T
            fun convertNumericType(node: PartiqlAst.Type.NumericType): T
            fun convertTimestampType(node: PartiqlAst.Type.TimestampType): T
            fun convertCharacterType(node: PartiqlAst.Type.CharacterType): T
            fun convertCharacterVaryingType(node: PartiqlAst.Type.CharacterVaryingType): T
            fun convertMissingType(node: PartiqlAst.Type.MissingType): T
            fun convertStringType(node: PartiqlAst.Type.StringType): T
            fun convertSymbolType(node: PartiqlAst.Type.SymbolType): T
            fun convertBlobType(node: PartiqlAst.Type.BlobType): T
            fun convertClobType(node: PartiqlAst.Type.ClobType): T
            fun convertDateType(node: PartiqlAst.Type.DateType): T
            fun convertTimeType(node: PartiqlAst.Type.TimeType): T
            fun convertTimeWithTimeZoneType(node: PartiqlAst.Type.TimeWithTimeZoneType): T
            fun convertStructType(node: PartiqlAst.Type.StructType): T
            fun convertTupleType(node: PartiqlAst.Type.TupleType): T
            fun convertListType(node: PartiqlAst.Type.ListType): T
            fun convertSexpType(node: PartiqlAst.Type.SexpType): T
            fun convertBagType(node: PartiqlAst.Type.BagType): T
            fun convertAnyType(node: PartiqlAst.Type.AnyType): T
            fun convertCustomType(node: PartiqlAst.Type.CustomType): T
        }
    }
    
    /////////////////////////////////////////////////////////////////////////////
    // IonElementTransformer
    /////////////////////////////////////////////////////////////////////////////
    
    
    private class IonElementTransformer : IonElementTransformerBase() {
    
        override fun innerTransform(sexp: SexpElement): PartiqlAstNode {
            return when(sexp.tag) {
                //////////////////////////////////////
                // Tuple Types
                //////////////////////////////////////
                "time_value" -> {
                    sexp.requireArityOrMalformed(IntRange(6, 7))
                    val hour = sexp.getRequired(0).toLongPrimitive()
                    val minute = sexp.getRequired(1).toLongPrimitive()
                    val second = sexp.getRequired(2).toLongPrimitive()
                    val nano = sexp.getRequired(3).toLongPrimitive()
                    val precision = sexp.getRequired(4).toLongPrimitive()
                    val withTimeZone = sexp.getRequired(5).toBoolPrimitive()
                    val tzMinutes = sexp.getOptional(6)?.toLongPrimitive()
                    PartiqlAst.TimeValue(
                        hour,
                        minute,
                        second,
                        nano,
                        precision,
                        withTimeZone,
                        tzMinutes,
                        metas = sexp.metas)
                }
                "let" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val letBindings = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Let(
                        letBindings,
                        metas = sexp.metas)
                }
                "let_binding" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val expr = sexp.getRequired(0).transformExpect()
                    val name = sexp.getRequired(1).toSymbolPrimitive()
                    PartiqlAst.LetBinding(
                        expr,
                        name,
                        metas = sexp.metas)
                }
                "graph_match_quantifier" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 2))
                    val lower = sexp.getRequired(0).toLongPrimitive()
                    val upper = sexp.getOptional(1)?.toLongPrimitive()
                    PartiqlAst.GraphMatchQuantifier(
                        lower,
                        upper,
                        metas = sexp.metas)
                }
                "graph_match_pattern" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val restrictor = sexp.getOptional(0)?.transformExpect()
                    val prefilter = sexp.getOptional(1)?.transformExpect()
                    val variable = sexp.getOptional(2)?.toSymbolPrimitive()
                    val quantifier = sexp.getOptional(3)?.transformExpect()
                    val parts = sexp.values.drop(5).map { it.transformExpect() }
                    PartiqlAst.GraphMatchPattern(
                        restrictor,
                        prefilter,
                        variable,
                        quantifier,
                        parts,
                        metas = sexp.metas)
                }
                "gpml_pattern" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val selector = sexp.getOptional(0)?.transformExpect()
                    val patterns = sexp.values.drop(2).map { it.transformExpect() }
                    PartiqlAst.GpmlPattern(
                        selector,
                        patterns,
                        metas = sexp.metas)
                }
                "expr_pair" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val first = sexp.getRequired(0).transformExpect()
                    val second = sexp.getRequired(1).transformExpect()
                    PartiqlAst.ExprPair(
                        first,
                        second,
                        metas = sexp.metas)
                }
                "expr_pair_list" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val pairs = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.ExprPairList(
                        pairs,
                        metas = sexp.metas)
                }
                "group_by" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 3))
                    val strategy = sexp.getRequired(0).transformExpect()
                    val keyList = sexp.getRequired(1).transformExpect()
                    val groupAsAlias = sexp.getOptional(2)?.toSymbolPrimitive()
                    PartiqlAst.GroupBy(
                        strategy,
                        keyList,
                        groupAsAlias,
                        metas = sexp.metas)
                }
                "group_key_list" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val keys = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.GroupKeyList(
                        keys,
                        metas = sexp.metas)
                }
                "group_key" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 2))
                    val expr = sexp.getRequired(0).transformExpect()
                    val asAlias = sexp.getOptional(1)?.toSymbolPrimitive()
                    PartiqlAst.GroupKey(
                        expr,
                        asAlias,
                        metas = sexp.metas)
                }
                "order_by" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val sortSpecs = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.OrderBy(
                        sortSpecs,
                        metas = sexp.metas)
                }
                "sort_spec" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 3))
                    val expr = sexp.getRequired(0).transformExpect()
                    val orderingSpec = sexp.getOptional(1)?.transformExpect()
                    val nullsSpec = sexp.getOptional(2)?.transformExpect()
                    PartiqlAst.SortSpec(
                        expr,
                        orderingSpec,
                        nullsSpec,
                        metas = sexp.metas)
                }
                "over" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2))
                    val partitionBy = sexp.getOptional(0)?.transformExpect()
                    val orderBy = sexp.getOptional(1)?.transformExpect()
                    PartiqlAst.Over(
                        partitionBy,
                        orderBy,
                        metas = sexp.metas)
                }
                "window_partition_list" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val exprs = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.WindowPartitionList(
                        exprs,
                        metas = sexp.metas)
                }
                "window_sort_spec_list" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val sortSpecs = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.WindowSortSpecList(
                        sortSpecs,
                        metas = sexp.metas)
                }
                "dml_op_list" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val ops = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.DmlOpList(
                        ops,
                        metas = sexp.metas)
                }
                "on_conflict" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val expr = sexp.getRequired(0).transformExpect()
                    val conflictAction = sexp.getRequired(1).transformExpect()
                    PartiqlAst.OnConflict(
                        expr,
                        conflictAction,
                        metas = sexp.metas)
                }
                "returning_expr" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val elems = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.ReturningExpr(
                        elems,
                        metas = sexp.metas)
                }
                "returning_elem" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val mapping = sexp.getRequired(0).transformExpect()
                    val column = sexp.getRequired(1).transformExpect()
                    PartiqlAst.ReturningElem(
                        mapping,
                        column,
                        metas = sexp.metas)
                }
                "identifier" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val name = sexp.getRequired(0).toSymbolPrimitive()
                    val case = sexp.getRequired(1).transformExpect()
                    PartiqlAst.Identifier(
                        name,
                        case,
                        metas = sexp.metas)
                }
                "assignment" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val target = sexp.getRequired(0).transformExpect()
                    val value = sexp.getRequired(1).transformExpect()
                    PartiqlAst.Assignment(
                        target,
                        value,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'Statement'
                //////////////////////////////////////
                "query" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val expr = sexp.getRequired(0).transformExpect()
                    PartiqlAst.Statement.Query(
                        expr,
                        metas = sexp.metas)
                }
                "dml" -> {
                    val ir = sexp.transformToIntermediateRecord()
            
                    val operations = ir.processRequiredField("operations") { it.transformExpect() }
                    val from = ir.processOptionalField("from") { it.transformExpect() }
                    val where = ir.processOptionalField("where") { it.transformExpect() }
                    val returning = ir.processOptionalField("returning") { it.transformExpect() }
            
                    ir.malformedIfAnyUnprocessedFieldsRemain()
            
                    Statement.Dml(operations, from, where, returning, metas = sexp.metas)
                }
                "ddl" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val op = sexp.getRequired(0).transformExpect()
                    PartiqlAst.Statement.Ddl(
                        op,
                        metas = sexp.metas)
                }
                "exec" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 2147483647))
                    val procedureName = sexp.getRequired(0).toSymbolPrimitive()
                    val args = sexp.values.drop(2).map { it.transformExpect() }
                    PartiqlAst.Statement.Exec(
                        procedureName,
                        args,
                        metas = sexp.metas)
                }
                "explain" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val target = sexp.getRequired(0).transformExpect()
                    PartiqlAst.Statement.Explain(
                        target,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'ExplainTarget'
                //////////////////////////////////////
                "domain" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 3))
                    val statement = sexp.getRequired(0).transformExpect()
                    val type = sexp.getOptional(1)?.toSymbolPrimitive()
                    val format = sexp.getOptional(2)?.toSymbolPrimitive()
                    PartiqlAst.ExplainTarget.Domain(
                        statement,
                        type,
                        format,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'Expr'
                //////////////////////////////////////
                "missing" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Expr.Missing(
                        metas = sexp.metas)
                }
                "lit" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val value = sexp.getRequiredIon(0)
                    PartiqlAst.Expr.Lit(
                        value,
                        metas = sexp.metas)
                }
                "id" -> {
                    sexp.requireArityOrMalformed(IntRange(3, 3))
                    val name = sexp.getRequired(0).toSymbolPrimitive()
                    val case = sexp.getRequired(1).transformExpect()
                    val qualifier = sexp.getRequired(2).transformExpect()
                    PartiqlAst.Expr.Id(
                        name,
                        case,
                        qualifier,
                        metas = sexp.metas)
                }
                "parameter" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val index = sexp.getRequired(0).toLongPrimitive()
                    PartiqlAst.Expr.Parameter(
                        index,
                        metas = sexp.metas)
                }
                "not" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val expr = sexp.getRequired(0).transformExpect()
                    PartiqlAst.Expr.Not(
                        expr,
                        metas = sexp.metas)
                }
                "pos" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val expr = sexp.getRequired(0).transformExpect()
                    PartiqlAst.Expr.Pos(
                        expr,
                        metas = sexp.metas)
                }
                "neg" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val expr = sexp.getRequired(0).transformExpect()
                    PartiqlAst.Expr.Neg(
                        expr,
                        metas = sexp.metas)
                }
                "plus" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Plus(
                        operands,
                        metas = sexp.metas)
                }
                "minus" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Minus(
                        operands,
                        metas = sexp.metas)
                }
                "times" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Times(
                        operands,
                        metas = sexp.metas)
                }
                "divide" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Divide(
                        operands,
                        metas = sexp.metas)
                }
                "modulo" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Modulo(
                        operands,
                        metas = sexp.metas)
                }
                "concat" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Concat(
                        operands,
                        metas = sexp.metas)
                }
                "and" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.And(
                        operands,
                        metas = sexp.metas)
                }
                "or" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Or(
                        operands,
                        metas = sexp.metas)
                }
                "eq" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Eq(
                        operands,
                        metas = sexp.metas)
                }
                "ne" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Ne(
                        operands,
                        metas = sexp.metas)
                }
                "gt" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Gt(
                        operands,
                        metas = sexp.metas)
                }
                "gte" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Gte(
                        operands,
                        metas = sexp.metas)
                }
                "lt" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Lt(
                        operands,
                        metas = sexp.metas)
                }
                "lte" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Lte(
                        operands,
                        metas = sexp.metas)
                }
                "like" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 3))
                    val value = sexp.getRequired(0).transformExpect()
                    val pattern = sexp.getRequired(1).transformExpect()
                    val escape = sexp.getOptional(2)?.transformExpect()
                    PartiqlAst.Expr.Like(
                        value,
                        pattern,
                        escape,
                        metas = sexp.metas)
                }
                "between" -> {
                    sexp.requireArityOrMalformed(IntRange(3, 3))
                    val value = sexp.getRequired(0).transformExpect()
                    val from = sexp.getRequired(1).transformExpect()
                    val to = sexp.getRequired(2).transformExpect()
                    PartiqlAst.Expr.Between(
                        value,
                        from,
                        to,
                        metas = sexp.metas)
                }
                "in_collection" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.InCollection(
                        operands,
                        metas = sexp.metas)
                }
                "is_type" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val value = sexp.getRequired(0).transformExpect()
                    val type = sexp.getRequired(1).transformExpect()
                    PartiqlAst.Expr.IsType(
                        value,
                        type,
                        metas = sexp.metas)
                }
                "simple_case" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 3))
                    val expr = sexp.getRequired(0).transformExpect()
                    val cases = sexp.getRequired(1).transformExpect()
                    val default = sexp.getOptional(2)?.transformExpect()
                    PartiqlAst.Expr.SimpleCase(
                        expr,
                        cases,
                        default,
                        metas = sexp.metas)
                }
                "searched_case" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 2))
                    val cases = sexp.getRequired(0).transformExpect()
                    val default = sexp.getOptional(1)?.transformExpect()
                    PartiqlAst.Expr.SearchedCase(
                        cases,
                        default,
                        metas = sexp.metas)
                }
                "struct" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val fields = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Struct(
                        fields,
                        metas = sexp.metas)
                }
                "bag" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val values = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Bag(
                        values,
                        metas = sexp.metas)
                }
                "list" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val values = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.List(
                        values,
                        metas = sexp.metas)
                }
                "sexp" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val values = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Sexp(
                        values,
                        metas = sexp.metas)
                }
                "date" -> {
                    sexp.requireArityOrMalformed(IntRange(3, 3))
                    val year = sexp.getRequired(0).toLongPrimitive()
                    val month = sexp.getRequired(1).toLongPrimitive()
                    val day = sexp.getRequired(2).toLongPrimitive()
                    PartiqlAst.Expr.Date(
                        year,
                        month,
                        day,
                        metas = sexp.metas)
                }
                "lit_time" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val value = sexp.getRequired(0).transformExpect()
                    PartiqlAst.Expr.LitTime(
                        value,
                        metas = sexp.metas)
                }
                "bag_op" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2147483647))
                    val op = sexp.getRequired(0).transformExpect()
                    val quantifier = sexp.getRequired(1).transformExpect()
                    val operands = sexp.values.drop(3).map { it.transformExpect() }
                    PartiqlAst.Expr.BagOp(
                        op,
                        quantifier,
                        operands,
                        metas = sexp.metas)
                }
                "graph_match" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val expr = sexp.getRequired(0).transformExpect()
                    val gpmlPattern = sexp.getRequired(1).transformExpect()
                    PartiqlAst.Expr.GraphMatch(
                        expr,
                        gpmlPattern,
                        metas = sexp.metas)
                }
                "path" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 2147483647))
                    val root = sexp.getRequired(0).transformExpect()
                    val steps = sexp.values.drop(2).map { it.transformExpect() }
                    PartiqlAst.Expr.Path(
                        root,
                        steps,
                        metas = sexp.metas)
                }
                "call" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 2147483647))
                    val funcName = sexp.getRequired(0).toSymbolPrimitive()
                    val args = sexp.values.drop(2).map { it.transformExpect() }
                    PartiqlAst.Expr.Call(
                        funcName,
                        args,
                        metas = sexp.metas)
                }
                "call_agg" -> {
                    sexp.requireArityOrMalformed(IntRange(3, 3))
                    val setq = sexp.getRequired(0).transformExpect()
                    val funcName = sexp.getRequired(1).toSymbolPrimitive()
                    val arg = sexp.getRequired(2).transformExpect()
                    PartiqlAst.Expr.CallAgg(
                        setq,
                        funcName,
                        arg,
                        metas = sexp.metas)
                }
                "call_window" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2147483647))
                    val funcName = sexp.getRequired(0).toSymbolPrimitive()
                    val over = sexp.getRequired(1).transformExpect()
                    val args = sexp.values.drop(3).map { it.transformExpect() }
                    PartiqlAst.Expr.CallWindow(
                        funcName,
                        over,
                        args,
                        metas = sexp.metas)
                }
                "cast" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val value = sexp.getRequired(0).transformExpect()
                    val asType = sexp.getRequired(1).transformExpect()
                    PartiqlAst.Expr.Cast(
                        value,
                        asType,
                        metas = sexp.metas)
                }
                "can_cast" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val value = sexp.getRequired(0).transformExpect()
                    val asType = sexp.getRequired(1).transformExpect()
                    PartiqlAst.Expr.CanCast(
                        value,
                        asType,
                        metas = sexp.metas)
                }
                "can_lossless_cast" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val value = sexp.getRequired(0).transformExpect()
                    val asType = sexp.getRequired(1).transformExpect()
                    PartiqlAst.Expr.CanLosslessCast(
                        value,
                        asType,
                        metas = sexp.metas)
                }
                "null_if" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val expr1 = sexp.getRequired(0).transformExpect()
                    val expr2 = sexp.getRequired(1).transformExpect()
                    PartiqlAst.Expr.NullIf(
                        expr1,
                        expr2,
                        metas = sexp.metas)
                }
                "coalesce" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val args = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Expr.Coalesce(
                        args,
                        metas = sexp.metas)
                }
                "select" -> {
                    val ir = sexp.transformToIntermediateRecord()
            
                    val setq = ir.processOptionalField("setq") { it.transformExpect() }
                    val project = ir.processRequiredField("project") { it.transformExpect() }
                    val from = ir.processRequiredField("from") { it.transformExpect() }
                    val fromLet = ir.processOptionalField("from_let") { it.transformExpect() }
                    val where = ir.processOptionalField("where") { it.transformExpect() }
                    val group = ir.processOptionalField("group") { it.transformExpect() }
                    val having = ir.processOptionalField("having") { it.transformExpect() }
                    val order = ir.processOptionalField("order") { it.transformExpect() }
                    val limit = ir.processOptionalField("limit") { it.transformExpect() }
                    val offset = ir.processOptionalField("offset") { it.transformExpect() }
            
                    ir.malformedIfAnyUnprocessedFieldsRemain()
            
                    Expr.Select(setq, project, from, fromLet, where, group, having, order, limit, offset, metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'PathStep'
                //////////////////////////////////////
                "path_expr" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val index = sexp.getRequired(0).transformExpect()
                    val case = sexp.getRequired(1).transformExpect()
                    PartiqlAst.PathStep.PathExpr(
                        index,
                        case,
                        metas = sexp.metas)
                }
                "path_wildcard" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.PathStep.PathWildcard(
                        metas = sexp.metas)
                }
                "path_unpivot" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.PathStep.PathUnpivot(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'Projection'
                //////////////////////////////////////
                "project_star" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Projection.ProjectStar(
                        metas = sexp.metas)
                }
                "project_list" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val projectItems = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlAst.Projection.ProjectList(
                        projectItems,
                        metas = sexp.metas)
                }
                "project_pivot" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val value = sexp.getRequired(0).transformExpect()
                    val key = sexp.getRequired(1).transformExpect()
                    PartiqlAst.Projection.ProjectPivot(
                        value,
                        key,
                        metas = sexp.metas)
                }
                "project_value" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val value = sexp.getRequired(0).transformExpect()
                    PartiqlAst.Projection.ProjectValue(
                        value,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'ProjectItem'
                //////////////////////////////////////
                "project_all" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val expr = sexp.getRequired(0).transformExpect()
                    PartiqlAst.ProjectItem.ProjectAll(
                        expr,
                        metas = sexp.metas)
                }
                "project_expr" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 2))
                    val expr = sexp.getRequired(0).transformExpect()
                    val asAlias = sexp.getOptional(1)?.toSymbolPrimitive()
                    PartiqlAst.ProjectItem.ProjectExpr(
                        expr,
                        asAlias,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'FromSource'
                //////////////////////////////////////
                "scan" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 4))
                    val expr = sexp.getRequired(0).transformExpect()
                    val asAlias = sexp.getOptional(1)?.toSymbolPrimitive()
                    val atAlias = sexp.getOptional(2)?.toSymbolPrimitive()
                    val byAlias = sexp.getOptional(3)?.toSymbolPrimitive()
                    PartiqlAst.FromSource.Scan(
                        expr,
                        asAlias,
                        atAlias,
                        byAlias,
                        metas = sexp.metas)
                }
                "unpivot" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 4))
                    val expr = sexp.getRequired(0).transformExpect()
                    val asAlias = sexp.getOptional(1)?.toSymbolPrimitive()
                    val atAlias = sexp.getOptional(2)?.toSymbolPrimitive()
                    val byAlias = sexp.getOptional(3)?.toSymbolPrimitive()
                    PartiqlAst.FromSource.Unpivot(
                        expr,
                        asAlias,
                        atAlias,
                        byAlias,
                        metas = sexp.metas)
                }
                "join" -> {
                    sexp.requireArityOrMalformed(IntRange(3, 4))
                    val type = sexp.getRequired(0).transformExpect()
                    val left = sexp.getRequired(1).transformExpect()
                    val right = sexp.getRequired(2).transformExpect()
                    val predicate = sexp.getOptional(3)?.transformExpect()
                    PartiqlAst.FromSource.Join(
                        type,
                        left,
                        right,
                        predicate,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'JoinType'
                //////////////////////////////////////
                "inner" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.JoinType.Inner(
                        metas = sexp.metas)
                }
                "left" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.JoinType.Left(
                        metas = sexp.metas)
                }
                "right" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.JoinType.Right(
                        metas = sexp.metas)
                }
                "full" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.JoinType.Full(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'GraphMatchDirection'
                //////////////////////////////////////
                "edge_left" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GraphMatchDirection.EdgeLeft(
                        metas = sexp.metas)
                }
                "edge_undirected" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GraphMatchDirection.EdgeUndirected(
                        metas = sexp.metas)
                }
                "edge_right" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GraphMatchDirection.EdgeRight(
                        metas = sexp.metas)
                }
                "edge_left_or_undirected" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected(
                        metas = sexp.metas)
                }
                "edge_undirected_or_right" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight(
                        metas = sexp.metas)
                }
                "edge_left_or_right" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GraphMatchDirection.EdgeLeftOrRight(
                        metas = sexp.metas)
                }
                "edge_left_or_undirected_or_right" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'GraphMatchPatternPart'
                //////////////////////////////////////
                "node" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val prefilter = sexp.getOptional(0)?.transformExpect()
                    val variable = sexp.getOptional(1)?.toSymbolPrimitive()
                    val label = sexp.values.drop(3).map { it.toSymbolPrimitive() }
                    PartiqlAst.GraphMatchPatternPart.Node(
                        prefilter,
                        variable,
                        label,
                        metas = sexp.metas)
                }
                "edge" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 2147483647))
                    val direction = sexp.getRequired(0).transformExpect()
                    val quantifier = sexp.getOptional(1)?.transformExpect()
                    val prefilter = sexp.getOptional(2)?.transformExpect()
                    val variable = sexp.getOptional(3)?.toSymbolPrimitive()
                    val label = sexp.values.drop(5).map { it.toSymbolPrimitive() }
                    PartiqlAst.GraphMatchPatternPart.Edge(
                        direction,
                        quantifier,
                        prefilter,
                        variable,
                        label,
                        metas = sexp.metas)
                }
                "pattern" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val pattern = sexp.getRequired(0).transformExpect()
                    PartiqlAst.GraphMatchPatternPart.Pattern(
                        pattern,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'GraphMatchRestrictor'
                //////////////////////////////////////
                "restrictor_trail" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GraphMatchRestrictor.RestrictorTrail(
                        metas = sexp.metas)
                }
                "restrictor_acyclic" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic(
                        metas = sexp.metas)
                }
                "restrictor_simple" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GraphMatchRestrictor.RestrictorSimple(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'GraphMatchSelector'
                //////////////////////////////////////
                "selector_any_shortest" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GraphMatchSelector.SelectorAnyShortest(
                        metas = sexp.metas)
                }
                "selector_all_shortest" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GraphMatchSelector.SelectorAllShortest(
                        metas = sexp.metas)
                }
                "selector_any" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GraphMatchSelector.SelectorAny(
                        metas = sexp.metas)
                }
                "selector_any_k" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val k = sexp.getRequired(0).toLongPrimitive()
                    PartiqlAst.GraphMatchSelector.SelectorAnyK(
                        k,
                        metas = sexp.metas)
                }
                "selector_shortest_k" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val k = sexp.getRequired(0).toLongPrimitive()
                    PartiqlAst.GraphMatchSelector.SelectorShortestK(
                        k,
                        metas = sexp.metas)
                }
                "selector_shortest_k_group" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val k = sexp.getRequired(0).toLongPrimitive()
                    PartiqlAst.GraphMatchSelector.SelectorShortestKGroup(
                        k,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'GroupingStrategy'
                //////////////////////////////////////
                "group_full" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GroupingStrategy.GroupFull(
                        metas = sexp.metas)
                }
                "group_partial" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.GroupingStrategy.GroupPartial(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'OrderingSpec'
                //////////////////////////////////////
                "asc" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.OrderingSpec.Asc(
                        metas = sexp.metas)
                }
                "desc" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.OrderingSpec.Desc(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'NullsSpec'
                //////////////////////////////////////
                "nulls_first" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.NullsSpec.NullsFirst(
                        metas = sexp.metas)
                }
                "nulls_last" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.NullsSpec.NullsLast(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'CaseSensitivity'
                //////////////////////////////////////
                "case_sensitive" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.CaseSensitivity.CaseSensitive(
                        metas = sexp.metas)
                }
                "case_insensitive" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.CaseSensitivity.CaseInsensitive(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'ScopeQualifier'
                //////////////////////////////////////
                "unqualified" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.ScopeQualifier.Unqualified(
                        metas = sexp.metas)
                }
                "locals_first" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.ScopeQualifier.LocalsFirst(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'SetQuantifier'
                //////////////////////////////////////
                "all" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.SetQuantifier.All(
                        metas = sexp.metas)
                }
                "distinct" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.SetQuantifier.Distinct(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'BagOpType'
                //////////////////////////////////////
                "union" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.BagOpType.Union(
                        metas = sexp.metas)
                }
                "intersect" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.BagOpType.Intersect(
                        metas = sexp.metas)
                }
                "except" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.BagOpType.Except(
                        metas = sexp.metas)
                }
                "outer_union" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.BagOpType.OuterUnion(
                        metas = sexp.metas)
                }
                "outer_intersect" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.BagOpType.OuterIntersect(
                        metas = sexp.metas)
                }
                "outer_except" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.BagOpType.OuterExcept(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'DmlOp'
                //////////////////////////////////////
                "insert" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 3))
                    val target = sexp.getRequired(0).transformExpect()
                    val values = sexp.getRequired(1).transformExpect()
                    val conflictAction = sexp.getOptional(2)?.transformExpect()
                    PartiqlAst.DmlOp.Insert(
                        target,
                        values,
                        conflictAction,
                        metas = sexp.metas)
                }
                "insert_value" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 4))
                    val target = sexp.getRequired(0).transformExpect()
                    val value = sexp.getRequired(1).transformExpect()
                    val index = sexp.getOptional(2)?.transformExpect()
                    val onConflict = sexp.getOptional(3)?.transformExpect()
                    PartiqlAst.DmlOp.InsertValue(
                        target,
                        value,
                        index,
                        onConflict,
                        metas = sexp.metas)
                }
                "set" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val assignment = sexp.getRequired(0).transformExpect()
                    PartiqlAst.DmlOp.Set(
                        assignment,
                        metas = sexp.metas)
                }
                "remove" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val target = sexp.getRequired(0).transformExpect()
                    PartiqlAst.DmlOp.Remove(
                        target,
                        metas = sexp.metas)
                }
                "delete" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.DmlOp.Delete(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'ConflictAction'
                //////////////////////////////////////
                "do_replace" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val value = sexp.getRequired(0).transformExpect()
                    PartiqlAst.ConflictAction.DoReplace(
                        value,
                        metas = sexp.metas)
                }
                "do_update" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val value = sexp.getRequired(0).transformExpect()
                    PartiqlAst.ConflictAction.DoUpdate(
                        value,
                        metas = sexp.metas)
                }
                "do_nothing" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.ConflictAction.DoNothing(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'OnConflictValue'
                //////////////////////////////////////
                "excluded" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.OnConflictValue.Excluded(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'DdlOp'
                //////////////////////////////////////
                "create_table" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val tableName = sexp.getRequired(0).toSymbolPrimitive()
                    PartiqlAst.DdlOp.CreateTable(
                        tableName,
                        metas = sexp.metas)
                }
                "drop_table" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val tableName = sexp.getRequired(0).transformExpect()
                    PartiqlAst.DdlOp.DropTable(
                        tableName,
                        metas = sexp.metas)
                }
                "create_index" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 2147483647))
                    val indexName = sexp.getRequired(0).transformExpect()
                    val fields = sexp.values.drop(2).map { it.transformExpect() }
                    PartiqlAst.DdlOp.CreateIndex(
                        indexName,
                        fields,
                        metas = sexp.metas)
                }
                "drop_index" -> {
                    val ir = sexp.transformToIntermediateRecord()
            
                    val table = ir.processRequiredField("table") { it.transformExpect() }
                    val keys = ir.processRequiredField("keys") { it.transformExpect() }
            
                    ir.malformedIfAnyUnprocessedFieldsRemain()
            
                    DdlOp.DropIndex(table, keys, metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'ColumnComponent'
                //////////////////////////////////////
                "returning_wildcard" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.ColumnComponent.ReturningWildcard(
                        metas = sexp.metas)
                }
                "returning_column" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val expr = sexp.getRequired(0).transformExpect()
                    PartiqlAst.ColumnComponent.ReturningColumn(
                        expr,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'ReturningMapping'
                //////////////////////////////////////
                "modified_new" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.ReturningMapping.ModifiedNew(
                        metas = sexp.metas)
                }
                "modified_old" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.ReturningMapping.ModifiedOld(
                        metas = sexp.metas)
                }
                "all_new" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.ReturningMapping.AllNew(
                        metas = sexp.metas)
                }
                "all_old" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.ReturningMapping.AllOld(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'Type'
                //////////////////////////////////////
                "null_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.NullType(
                        metas = sexp.metas)
                }
                "boolean_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.BooleanType(
                        metas = sexp.metas)
                }
                "smallint_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.SmallintType(
                        metas = sexp.metas)
                }
                "integer4_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.Integer4Type(
                        metas = sexp.metas)
                }
                "integer8_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.Integer8Type(
                        metas = sexp.metas)
                }
                "integer_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.IntegerType(
                        metas = sexp.metas)
                }
                "float_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 1))
                    val precision = sexp.getOptional(0)?.toLongPrimitive()
                    PartiqlAst.Type.FloatType(
                        precision,
                        metas = sexp.metas)
                }
                "real_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.RealType(
                        metas = sexp.metas)
                }
                "double_precision_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.DoublePrecisionType(
                        metas = sexp.metas)
                }
                "decimal_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2))
                    val precision = sexp.getOptional(0)?.toLongPrimitive()
                    val scale = sexp.getOptional(1)?.toLongPrimitive()
                    PartiqlAst.Type.DecimalType(
                        precision,
                        scale,
                        metas = sexp.metas)
                }
                "numeric_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2))
                    val precision = sexp.getOptional(0)?.toLongPrimitive()
                    val scale = sexp.getOptional(1)?.toLongPrimitive()
                    PartiqlAst.Type.NumericType(
                        precision,
                        scale,
                        metas = sexp.metas)
                }
                "timestamp_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.TimestampType(
                        metas = sexp.metas)
                }
                "character_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 1))
                    val length = sexp.getOptional(0)?.toLongPrimitive()
                    PartiqlAst.Type.CharacterType(
                        length,
                        metas = sexp.metas)
                }
                "character_varying_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 1))
                    val length = sexp.getOptional(0)?.toLongPrimitive()
                    PartiqlAst.Type.CharacterVaryingType(
                        length,
                        metas = sexp.metas)
                }
                "missing_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.MissingType(
                        metas = sexp.metas)
                }
                "string_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.StringType(
                        metas = sexp.metas)
                }
                "symbol_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.SymbolType(
                        metas = sexp.metas)
                }
                "blob_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.BlobType(
                        metas = sexp.metas)
                }
                "clob_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.ClobType(
                        metas = sexp.metas)
                }
                "date_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.DateType(
                        metas = sexp.metas)
                }
                "time_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 1))
                    val precision = sexp.getOptional(0)?.toLongPrimitive()
                    PartiqlAst.Type.TimeType(
                        precision,
                        metas = sexp.metas)
                }
                "time_with_time_zone_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 1))
                    val precision = sexp.getOptional(0)?.toLongPrimitive()
                    PartiqlAst.Type.TimeWithTimeZoneType(
                        precision,
                        metas = sexp.metas)
                }
                "struct_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.StructType(
                        metas = sexp.metas)
                }
                "tuple_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.TupleType(
                        metas = sexp.metas)
                }
                "list_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.ListType(
                        metas = sexp.metas)
                }
                "sexp_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.SexpType(
                        metas = sexp.metas)
                }
                "bag_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.BagType(
                        metas = sexp.metas)
                }
                "any_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlAst.Type.AnyType(
                        metas = sexp.metas)
                }
                "custom_type" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val name = sexp.getRequired(0).toSymbolPrimitive()
                    PartiqlAst.Type.CustomType(
                        name,
                        metas = sexp.metas)
                }
                else -> errMalformed(sexp.head.metas.location, "Unknown tag '${sexp.tag}' for domain 'partiql_ast'")
            }
        }
    }
    
    open class Visitor : DomainVisitorBase() {
        ////////////////////////////////////////////////////////////////////////////
        // Visit Functions
        ////////////////////////////////////////////////////////////////////////////
    
        //////////////////////////////////////
        // Tuple Types
        //////////////////////////////////////
        open fun visitTimeValue(node: PartiqlAst.TimeValue) { }
        open fun visitLet(node: PartiqlAst.Let) { }
        open fun visitLetBinding(node: PartiqlAst.LetBinding) { }
        open fun visitGraphMatchQuantifier(node: PartiqlAst.GraphMatchQuantifier) { }
        open fun visitGraphMatchPattern(node: PartiqlAst.GraphMatchPattern) { }
        open fun visitGpmlPattern(node: PartiqlAst.GpmlPattern) { }
        open fun visitExprPair(node: PartiqlAst.ExprPair) { }
        open fun visitExprPairList(node: PartiqlAst.ExprPairList) { }
        open fun visitGroupBy(node: PartiqlAst.GroupBy) { }
        open fun visitGroupKeyList(node: PartiqlAst.GroupKeyList) { }
        open fun visitGroupKey(node: PartiqlAst.GroupKey) { }
        open fun visitOrderBy(node: PartiqlAst.OrderBy) { }
        open fun visitSortSpec(node: PartiqlAst.SortSpec) { }
        open fun visitOver(node: PartiqlAst.Over) { }
        open fun visitWindowPartitionList(node: PartiqlAst.WindowPartitionList) { }
        open fun visitWindowSortSpecList(node: PartiqlAst.WindowSortSpecList) { }
        open fun visitDmlOpList(node: PartiqlAst.DmlOpList) { }
        open fun visitOnConflict(node: PartiqlAst.OnConflict) { }
        open fun visitReturningExpr(node: PartiqlAst.ReturningExpr) { }
        open fun visitReturningElem(node: PartiqlAst.ReturningElem) { }
        open fun visitIdentifier(node: PartiqlAst.Identifier) { }
        open fun visitAssignment(node: PartiqlAst.Assignment) { }
        //////////////////////////////////////
        // Sum Type: Statement
        //////////////////////////////////////
        protected open fun visitStatement(node: PartiqlAst.Statement) { }
        protected open fun visitStatementQuery(node: PartiqlAst.Statement.Query) { }
        protected open fun visitStatementDml(node: PartiqlAst.Statement.Dml) { }
        protected open fun visitStatementDdl(node: PartiqlAst.Statement.Ddl) { }
        protected open fun visitStatementExec(node: PartiqlAst.Statement.Exec) { }
        protected open fun visitStatementExplain(node: PartiqlAst.Statement.Explain) { }
        //////////////////////////////////////
        // Sum Type: ExplainTarget
        //////////////////////////////////////
        protected open fun visitExplainTarget(node: PartiqlAst.ExplainTarget) { }
        protected open fun visitExplainTargetDomain(node: PartiqlAst.ExplainTarget.Domain) { }
        //////////////////////////////////////
        // Sum Type: Expr
        //////////////////////////////////////
        protected open fun visitExpr(node: PartiqlAst.Expr) { }
        protected open fun visitExprMissing(node: PartiqlAst.Expr.Missing) { }
        protected open fun visitExprLit(node: PartiqlAst.Expr.Lit) { }
        protected open fun visitExprId(node: PartiqlAst.Expr.Id) { }
        protected open fun visitExprParameter(node: PartiqlAst.Expr.Parameter) { }
        protected open fun visitExprNot(node: PartiqlAst.Expr.Not) { }
        protected open fun visitExprPos(node: PartiqlAst.Expr.Pos) { }
        protected open fun visitExprNeg(node: PartiqlAst.Expr.Neg) { }
        protected open fun visitExprPlus(node: PartiqlAst.Expr.Plus) { }
        protected open fun visitExprMinus(node: PartiqlAst.Expr.Minus) { }
        protected open fun visitExprTimes(node: PartiqlAst.Expr.Times) { }
        protected open fun visitExprDivide(node: PartiqlAst.Expr.Divide) { }
        protected open fun visitExprModulo(node: PartiqlAst.Expr.Modulo) { }
        protected open fun visitExprConcat(node: PartiqlAst.Expr.Concat) { }
        protected open fun visitExprAnd(node: PartiqlAst.Expr.And) { }
        protected open fun visitExprOr(node: PartiqlAst.Expr.Or) { }
        protected open fun visitExprEq(node: PartiqlAst.Expr.Eq) { }
        protected open fun visitExprNe(node: PartiqlAst.Expr.Ne) { }
        protected open fun visitExprGt(node: PartiqlAst.Expr.Gt) { }
        protected open fun visitExprGte(node: PartiqlAst.Expr.Gte) { }
        protected open fun visitExprLt(node: PartiqlAst.Expr.Lt) { }
        protected open fun visitExprLte(node: PartiqlAst.Expr.Lte) { }
        protected open fun visitExprLike(node: PartiqlAst.Expr.Like) { }
        protected open fun visitExprBetween(node: PartiqlAst.Expr.Between) { }
        protected open fun visitExprInCollection(node: PartiqlAst.Expr.InCollection) { }
        protected open fun visitExprIsType(node: PartiqlAst.Expr.IsType) { }
        protected open fun visitExprSimpleCase(node: PartiqlAst.Expr.SimpleCase) { }
        protected open fun visitExprSearchedCase(node: PartiqlAst.Expr.SearchedCase) { }
        protected open fun visitExprStruct(node: PartiqlAst.Expr.Struct) { }
        protected open fun visitExprBag(node: PartiqlAst.Expr.Bag) { }
        protected open fun visitExprList(node: PartiqlAst.Expr.List) { }
        protected open fun visitExprSexp(node: PartiqlAst.Expr.Sexp) { }
        protected open fun visitExprDate(node: PartiqlAst.Expr.Date) { }
        protected open fun visitExprLitTime(node: PartiqlAst.Expr.LitTime) { }
        protected open fun visitExprBagOp(node: PartiqlAst.Expr.BagOp) { }
        protected open fun visitExprGraphMatch(node: PartiqlAst.Expr.GraphMatch) { }
        protected open fun visitExprPath(node: PartiqlAst.Expr.Path) { }
        protected open fun visitExprCall(node: PartiqlAst.Expr.Call) { }
        protected open fun visitExprCallAgg(node: PartiqlAst.Expr.CallAgg) { }
        protected open fun visitExprCallWindow(node: PartiqlAst.Expr.CallWindow) { }
        protected open fun visitExprCast(node: PartiqlAst.Expr.Cast) { }
        protected open fun visitExprCanCast(node: PartiqlAst.Expr.CanCast) { }
        protected open fun visitExprCanLosslessCast(node: PartiqlAst.Expr.CanLosslessCast) { }
        protected open fun visitExprNullIf(node: PartiqlAst.Expr.NullIf) { }
        protected open fun visitExprCoalesce(node: PartiqlAst.Expr.Coalesce) { }
        protected open fun visitExprSelect(node: PartiqlAst.Expr.Select) { }
        //////////////////////////////////////
        // Sum Type: PathStep
        //////////////////////////////////////
        protected open fun visitPathStep(node: PartiqlAst.PathStep) { }
        protected open fun visitPathStepPathExpr(node: PartiqlAst.PathStep.PathExpr) { }
        protected open fun visitPathStepPathWildcard(node: PartiqlAst.PathStep.PathWildcard) { }
        protected open fun visitPathStepPathUnpivot(node: PartiqlAst.PathStep.PathUnpivot) { }
        //////////////////////////////////////
        // Sum Type: Projection
        //////////////////////////////////////
        protected open fun visitProjection(node: PartiqlAst.Projection) { }
        protected open fun visitProjectionProjectStar(node: PartiqlAst.Projection.ProjectStar) { }
        protected open fun visitProjectionProjectList(node: PartiqlAst.Projection.ProjectList) { }
        protected open fun visitProjectionProjectPivot(node: PartiqlAst.Projection.ProjectPivot) { }
        protected open fun visitProjectionProjectValue(node: PartiqlAst.Projection.ProjectValue) { }
        //////////////////////////////////////
        // Sum Type: ProjectItem
        //////////////////////////////////////
        protected open fun visitProjectItem(node: PartiqlAst.ProjectItem) { }
        protected open fun visitProjectItemProjectAll(node: PartiqlAst.ProjectItem.ProjectAll) { }
        protected open fun visitProjectItemProjectExpr(node: PartiqlAst.ProjectItem.ProjectExpr) { }
        //////////////////////////////////////
        // Sum Type: FromSource
        //////////////////////////////////////
        protected open fun visitFromSource(node: PartiqlAst.FromSource) { }
        protected open fun visitFromSourceScan(node: PartiqlAst.FromSource.Scan) { }
        protected open fun visitFromSourceUnpivot(node: PartiqlAst.FromSource.Unpivot) { }
        protected open fun visitFromSourceJoin(node: PartiqlAst.FromSource.Join) { }
        //////////////////////////////////////
        // Sum Type: JoinType
        //////////////////////////////////////
        protected open fun visitJoinType(node: PartiqlAst.JoinType) { }
        protected open fun visitJoinTypeInner(node: PartiqlAst.JoinType.Inner) { }
        protected open fun visitJoinTypeLeft(node: PartiqlAst.JoinType.Left) { }
        protected open fun visitJoinTypeRight(node: PartiqlAst.JoinType.Right) { }
        protected open fun visitJoinTypeFull(node: PartiqlAst.JoinType.Full) { }
        //////////////////////////////////////
        // Sum Type: GraphMatchDirection
        //////////////////////////////////////
        protected open fun visitGraphMatchDirection(node: PartiqlAst.GraphMatchDirection) { }
        protected open fun visitGraphMatchDirectionEdgeLeft(node: PartiqlAst.GraphMatchDirection.EdgeLeft) { }
        protected open fun visitGraphMatchDirectionEdgeUndirected(node: PartiqlAst.GraphMatchDirection.EdgeUndirected) { }
        protected open fun visitGraphMatchDirectionEdgeRight(node: PartiqlAst.GraphMatchDirection.EdgeRight) { }
        protected open fun visitGraphMatchDirectionEdgeLeftOrUndirected(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected) { }
        protected open fun visitGraphMatchDirectionEdgeUndirectedOrRight(node: PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight) { }
        protected open fun visitGraphMatchDirectionEdgeLeftOrRight(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrRight) { }
        protected open fun visitGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight) { }
        //////////////////////////////////////
        // Sum Type: GraphMatchPatternPart
        //////////////////////////////////////
        protected open fun visitGraphMatchPatternPart(node: PartiqlAst.GraphMatchPatternPart) { }
        protected open fun visitGraphMatchPatternPartNode(node: PartiqlAst.GraphMatchPatternPart.Node) { }
        protected open fun visitGraphMatchPatternPartEdge(node: PartiqlAst.GraphMatchPatternPart.Edge) { }
        protected open fun visitGraphMatchPatternPartPattern(node: PartiqlAst.GraphMatchPatternPart.Pattern) { }
        //////////////////////////////////////
        // Sum Type: GraphMatchRestrictor
        //////////////////////////////////////
        protected open fun visitGraphMatchRestrictor(node: PartiqlAst.GraphMatchRestrictor) { }
        protected open fun visitGraphMatchRestrictorRestrictorTrail(node: PartiqlAst.GraphMatchRestrictor.RestrictorTrail) { }
        protected open fun visitGraphMatchRestrictorRestrictorAcyclic(node: PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic) { }
        protected open fun visitGraphMatchRestrictorRestrictorSimple(node: PartiqlAst.GraphMatchRestrictor.RestrictorSimple) { }
        //////////////////////////////////////
        // Sum Type: GraphMatchSelector
        //////////////////////////////////////
        protected open fun visitGraphMatchSelector(node: PartiqlAst.GraphMatchSelector) { }
        protected open fun visitGraphMatchSelectorSelectorAnyShortest(node: PartiqlAst.GraphMatchSelector.SelectorAnyShortest) { }
        protected open fun visitGraphMatchSelectorSelectorAllShortest(node: PartiqlAst.GraphMatchSelector.SelectorAllShortest) { }
        protected open fun visitGraphMatchSelectorSelectorAny(node: PartiqlAst.GraphMatchSelector.SelectorAny) { }
        protected open fun visitGraphMatchSelectorSelectorAnyK(node: PartiqlAst.GraphMatchSelector.SelectorAnyK) { }
        protected open fun visitGraphMatchSelectorSelectorShortestK(node: PartiqlAst.GraphMatchSelector.SelectorShortestK) { }
        protected open fun visitGraphMatchSelectorSelectorShortestKGroup(node: PartiqlAst.GraphMatchSelector.SelectorShortestKGroup) { }
        //////////////////////////////////////
        // Sum Type: GroupingStrategy
        //////////////////////////////////////
        protected open fun visitGroupingStrategy(node: PartiqlAst.GroupingStrategy) { }
        protected open fun visitGroupingStrategyGroupFull(node: PartiqlAst.GroupingStrategy.GroupFull) { }
        protected open fun visitGroupingStrategyGroupPartial(node: PartiqlAst.GroupingStrategy.GroupPartial) { }
        //////////////////////////////////////
        // Sum Type: OrderingSpec
        //////////////////////////////////////
        protected open fun visitOrderingSpec(node: PartiqlAst.OrderingSpec) { }
        protected open fun visitOrderingSpecAsc(node: PartiqlAst.OrderingSpec.Asc) { }
        protected open fun visitOrderingSpecDesc(node: PartiqlAst.OrderingSpec.Desc) { }
        //////////////////////////////////////
        // Sum Type: NullsSpec
        //////////////////////////////////////
        protected open fun visitNullsSpec(node: PartiqlAst.NullsSpec) { }
        protected open fun visitNullsSpecNullsFirst(node: PartiqlAst.NullsSpec.NullsFirst) { }
        protected open fun visitNullsSpecNullsLast(node: PartiqlAst.NullsSpec.NullsLast) { }
        //////////////////////////////////////
        // Sum Type: CaseSensitivity
        //////////////////////////////////////
        protected open fun visitCaseSensitivity(node: PartiqlAst.CaseSensitivity) { }
        protected open fun visitCaseSensitivityCaseSensitive(node: PartiqlAst.CaseSensitivity.CaseSensitive) { }
        protected open fun visitCaseSensitivityCaseInsensitive(node: PartiqlAst.CaseSensitivity.CaseInsensitive) { }
        //////////////////////////////////////
        // Sum Type: ScopeQualifier
        //////////////////////////////////////
        protected open fun visitScopeQualifier(node: PartiqlAst.ScopeQualifier) { }
        protected open fun visitScopeQualifierUnqualified(node: PartiqlAst.ScopeQualifier.Unqualified) { }
        protected open fun visitScopeQualifierLocalsFirst(node: PartiqlAst.ScopeQualifier.LocalsFirst) { }
        //////////////////////////////////////
        // Sum Type: SetQuantifier
        //////////////////////////////////////
        protected open fun visitSetQuantifier(node: PartiqlAst.SetQuantifier) { }
        protected open fun visitSetQuantifierAll(node: PartiqlAst.SetQuantifier.All) { }
        protected open fun visitSetQuantifierDistinct(node: PartiqlAst.SetQuantifier.Distinct) { }
        //////////////////////////////////////
        // Sum Type: BagOpType
        //////////////////////////////////////
        protected open fun visitBagOpType(node: PartiqlAst.BagOpType) { }
        protected open fun visitBagOpTypeUnion(node: PartiqlAst.BagOpType.Union) { }
        protected open fun visitBagOpTypeIntersect(node: PartiqlAst.BagOpType.Intersect) { }
        protected open fun visitBagOpTypeExcept(node: PartiqlAst.BagOpType.Except) { }
        protected open fun visitBagOpTypeOuterUnion(node: PartiqlAst.BagOpType.OuterUnion) { }
        protected open fun visitBagOpTypeOuterIntersect(node: PartiqlAst.BagOpType.OuterIntersect) { }
        protected open fun visitBagOpTypeOuterExcept(node: PartiqlAst.BagOpType.OuterExcept) { }
        //////////////////////////////////////
        // Sum Type: DmlOp
        //////////////////////////////////////
        protected open fun visitDmlOp(node: PartiqlAst.DmlOp) { }
        protected open fun visitDmlOpInsert(node: PartiqlAst.DmlOp.Insert) { }
        protected open fun visitDmlOpInsertValue(node: PartiqlAst.DmlOp.InsertValue) { }
        protected open fun visitDmlOpSet(node: PartiqlAst.DmlOp.Set) { }
        protected open fun visitDmlOpRemove(node: PartiqlAst.DmlOp.Remove) { }
        protected open fun visitDmlOpDelete(node: PartiqlAst.DmlOp.Delete) { }
        //////////////////////////////////////
        // Sum Type: ConflictAction
        //////////////////////////////////////
        protected open fun visitConflictAction(node: PartiqlAst.ConflictAction) { }
        protected open fun visitConflictActionDoReplace(node: PartiqlAst.ConflictAction.DoReplace) { }
        protected open fun visitConflictActionDoUpdate(node: PartiqlAst.ConflictAction.DoUpdate) { }
        protected open fun visitConflictActionDoNothing(node: PartiqlAst.ConflictAction.DoNothing) { }
        //////////////////////////////////////
        // Sum Type: OnConflictValue
        //////////////////////////////////////
        protected open fun visitOnConflictValue(node: PartiqlAst.OnConflictValue) { }
        protected open fun visitOnConflictValueExcluded(node: PartiqlAst.OnConflictValue.Excluded) { }
        //////////////////////////////////////
        // Sum Type: DdlOp
        //////////////////////////////////////
        protected open fun visitDdlOp(node: PartiqlAst.DdlOp) { }
        protected open fun visitDdlOpCreateTable(node: PartiqlAst.DdlOp.CreateTable) { }
        protected open fun visitDdlOpDropTable(node: PartiqlAst.DdlOp.DropTable) { }
        protected open fun visitDdlOpCreateIndex(node: PartiqlAst.DdlOp.CreateIndex) { }
        protected open fun visitDdlOpDropIndex(node: PartiqlAst.DdlOp.DropIndex) { }
        //////////////////////////////////////
        // Sum Type: ColumnComponent
        //////////////////////////////////////
        protected open fun visitColumnComponent(node: PartiqlAst.ColumnComponent) { }
        protected open fun visitColumnComponentReturningWildcard(node: PartiqlAst.ColumnComponent.ReturningWildcard) { }
        protected open fun visitColumnComponentReturningColumn(node: PartiqlAst.ColumnComponent.ReturningColumn) { }
        //////////////////////////////////////
        // Sum Type: ReturningMapping
        //////////////////////////////////////
        protected open fun visitReturningMapping(node: PartiqlAst.ReturningMapping) { }
        protected open fun visitReturningMappingModifiedNew(node: PartiqlAst.ReturningMapping.ModifiedNew) { }
        protected open fun visitReturningMappingModifiedOld(node: PartiqlAst.ReturningMapping.ModifiedOld) { }
        protected open fun visitReturningMappingAllNew(node: PartiqlAst.ReturningMapping.AllNew) { }
        protected open fun visitReturningMappingAllOld(node: PartiqlAst.ReturningMapping.AllOld) { }
        //////////////////////////////////////
        // Sum Type: Type
        //////////////////////////////////////
        protected open fun visitType(node: PartiqlAst.Type) { }
        protected open fun visitTypeNullType(node: PartiqlAst.Type.NullType) { }
        protected open fun visitTypeBooleanType(node: PartiqlAst.Type.BooleanType) { }
        protected open fun visitTypeSmallintType(node: PartiqlAst.Type.SmallintType) { }
        protected open fun visitTypeInteger4Type(node: PartiqlAst.Type.Integer4Type) { }
        protected open fun visitTypeInteger8Type(node: PartiqlAst.Type.Integer8Type) { }
        protected open fun visitTypeIntegerType(node: PartiqlAst.Type.IntegerType) { }
        protected open fun visitTypeFloatType(node: PartiqlAst.Type.FloatType) { }
        protected open fun visitTypeRealType(node: PartiqlAst.Type.RealType) { }
        protected open fun visitTypeDoublePrecisionType(node: PartiqlAst.Type.DoublePrecisionType) { }
        protected open fun visitTypeDecimalType(node: PartiqlAst.Type.DecimalType) { }
        protected open fun visitTypeNumericType(node: PartiqlAst.Type.NumericType) { }
        protected open fun visitTypeTimestampType(node: PartiqlAst.Type.TimestampType) { }
        protected open fun visitTypeCharacterType(node: PartiqlAst.Type.CharacterType) { }
        protected open fun visitTypeCharacterVaryingType(node: PartiqlAst.Type.CharacterVaryingType) { }
        protected open fun visitTypeMissingType(node: PartiqlAst.Type.MissingType) { }
        protected open fun visitTypeStringType(node: PartiqlAst.Type.StringType) { }
        protected open fun visitTypeSymbolType(node: PartiqlAst.Type.SymbolType) { }
        protected open fun visitTypeBlobType(node: PartiqlAst.Type.BlobType) { }
        protected open fun visitTypeClobType(node: PartiqlAst.Type.ClobType) { }
        protected open fun visitTypeDateType(node: PartiqlAst.Type.DateType) { }
        protected open fun visitTypeTimeType(node: PartiqlAst.Type.TimeType) { }
        protected open fun visitTypeTimeWithTimeZoneType(node: PartiqlAst.Type.TimeWithTimeZoneType) { }
        protected open fun visitTypeStructType(node: PartiqlAst.Type.StructType) { }
        protected open fun visitTypeTupleType(node: PartiqlAst.Type.TupleType) { }
        protected open fun visitTypeListType(node: PartiqlAst.Type.ListType) { }
        protected open fun visitTypeSexpType(node: PartiqlAst.Type.SexpType) { }
        protected open fun visitTypeBagType(node: PartiqlAst.Type.BagType) { }
        protected open fun visitTypeAnyType(node: PartiqlAst.Type.AnyType) { }
        protected open fun visitTypeCustomType(node: PartiqlAst.Type.CustomType) { }
    
        ////////////////////////////////////////////////////////////////////////////
        // Walk Functions
        ////////////////////////////////////////////////////////////////////////////
    
        //////////////////////////////////////
        // Tuple Types
        //////////////////////////////////////
        open fun walkTimeValue(node: PartiqlAst.TimeValue) {
            visitTimeValue(node)
            walkLongPrimitive(node.hour)
            walkLongPrimitive(node.minute)
            walkLongPrimitive(node.second)
            walkLongPrimitive(node.nano)
            walkLongPrimitive(node.precision)
            walkBoolPrimitive(node.withTimeZone)
            node.tzMinutes?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
    
        open fun walkLet(node: PartiqlAst.Let) {
            visitLet(node)
            node.letBindings.map { walkLetBinding(it) }
            walkMetas(node.metas)
        }
    
        open fun walkLetBinding(node: PartiqlAst.LetBinding) {
            visitLetBinding(node)
            walkExpr(node.expr)
            walkSymbolPrimitive(node.name)
            walkMetas(node.metas)
        }
    
        open fun walkGraphMatchQuantifier(node: PartiqlAst.GraphMatchQuantifier) {
            visitGraphMatchQuantifier(node)
            walkLongPrimitive(node.lower)
            node.upper?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
    
        open fun walkGraphMatchPattern(node: PartiqlAst.GraphMatchPattern) {
            visitGraphMatchPattern(node)
            node.restrictor?.let { walkGraphMatchRestrictor(it) }
            node.prefilter?.let { walkExpr(it) }
            node.variable?.let { walkSymbolPrimitive(it) }
            node.quantifier?.let { walkGraphMatchQuantifier(it) }
            node.parts.map { walkGraphMatchPatternPart(it) }
            walkMetas(node.metas)
        }
    
        open fun walkGpmlPattern(node: PartiqlAst.GpmlPattern) {
            visitGpmlPattern(node)
            node.selector?.let { walkGraphMatchSelector(it) }
            node.patterns.map { walkGraphMatchPattern(it) }
            walkMetas(node.metas)
        }
    
        open fun walkExprPair(node: PartiqlAst.ExprPair) {
            visitExprPair(node)
            walkExpr(node.first)
            walkExpr(node.second)
            walkMetas(node.metas)
        }
    
        open fun walkExprPairList(node: PartiqlAst.ExprPairList) {
            visitExprPairList(node)
            node.pairs.map { walkExprPair(it) }
            walkMetas(node.metas)
        }
    
        open fun walkGroupBy(node: PartiqlAst.GroupBy) {
            visitGroupBy(node)
            walkGroupingStrategy(node.strategy)
            walkGroupKeyList(node.keyList)
            node.groupAsAlias?.let { walkSymbolPrimitive(it) }
            walkMetas(node.metas)
        }
    
        open fun walkGroupKeyList(node: PartiqlAst.GroupKeyList) {
            visitGroupKeyList(node)
            node.keys.map { walkGroupKey(it) }
            walkMetas(node.metas)
        }
    
        open fun walkGroupKey(node: PartiqlAst.GroupKey) {
            visitGroupKey(node)
            walkExpr(node.expr)
            node.asAlias?.let { walkSymbolPrimitive(it) }
            walkMetas(node.metas)
        }
    
        open fun walkOrderBy(node: PartiqlAst.OrderBy) {
            visitOrderBy(node)
            node.sortSpecs.map { walkSortSpec(it) }
            walkMetas(node.metas)
        }
    
        open fun walkSortSpec(node: PartiqlAst.SortSpec) {
            visitSortSpec(node)
            walkExpr(node.expr)
            node.orderingSpec?.let { walkOrderingSpec(it) }
            node.nullsSpec?.let { walkNullsSpec(it) }
            walkMetas(node.metas)
        }
    
        open fun walkOver(node: PartiqlAst.Over) {
            visitOver(node)
            node.partitionBy?.let { walkWindowPartitionList(it) }
            node.orderBy?.let { walkWindowSortSpecList(it) }
            walkMetas(node.metas)
        }
    
        open fun walkWindowPartitionList(node: PartiqlAst.WindowPartitionList) {
            visitWindowPartitionList(node)
            node.exprs.map { walkExpr(it) }
            walkMetas(node.metas)
        }
    
        open fun walkWindowSortSpecList(node: PartiqlAst.WindowSortSpecList) {
            visitWindowSortSpecList(node)
            node.sortSpecs.map { walkSortSpec(it) }
            walkMetas(node.metas)
        }
    
        open fun walkDmlOpList(node: PartiqlAst.DmlOpList) {
            visitDmlOpList(node)
            node.ops.map { walkDmlOp(it) }
            walkMetas(node.metas)
        }
    
        open fun walkOnConflict(node: PartiqlAst.OnConflict) {
            visitOnConflict(node)
            walkExpr(node.expr)
            walkConflictAction(node.conflictAction)
            walkMetas(node.metas)
        }
    
        open fun walkReturningExpr(node: PartiqlAst.ReturningExpr) {
            visitReturningExpr(node)
            node.elems.map { walkReturningElem(it) }
            walkMetas(node.metas)
        }
    
        open fun walkReturningElem(node: PartiqlAst.ReturningElem) {
            visitReturningElem(node)
            walkReturningMapping(node.mapping)
            walkColumnComponent(node.column)
            walkMetas(node.metas)
        }
    
        open fun walkIdentifier(node: PartiqlAst.Identifier) {
            visitIdentifier(node)
            walkSymbolPrimitive(node.name)
            walkCaseSensitivity(node.case)
            walkMetas(node.metas)
        }
    
        open fun walkAssignment(node: PartiqlAst.Assignment) {
            visitAssignment(node)
            walkExpr(node.target)
            walkExpr(node.value)
            walkMetas(node.metas)
        }
    
        //////////////////////////////////////
        // Sum Type: Statement
        //////////////////////////////////////
        open fun walkStatement(node: PartiqlAst.Statement) {
            visitStatement(node)
            when(node) {
                is PartiqlAst.Statement.Query -> walkStatementQuery(node)
                is PartiqlAst.Statement.Dml -> walkStatementDml(node)
                is PartiqlAst.Statement.Ddl -> walkStatementDdl(node)
                is PartiqlAst.Statement.Exec -> walkStatementExec(node)
                is PartiqlAst.Statement.Explain -> walkStatementExplain(node)
            }
        }
    
        open fun walkStatementQuery(node: PartiqlAst.Statement.Query) {
            visitStatementQuery(node)
            walkExpr(node.expr)
            walkMetas(node.metas)
        }
        open fun walkStatementDml(node: PartiqlAst.Statement.Dml) {
            visitStatementDml(node)
            walkDmlOpList(node.operations)
            node.from?.let { walkFromSource(it) }
            node.where?.let { walkExpr(it) }
            node.returning?.let { walkReturningExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkStatementDdl(node: PartiqlAst.Statement.Ddl) {
            visitStatementDdl(node)
            walkDdlOp(node.op)
            walkMetas(node.metas)
        }
        open fun walkStatementExec(node: PartiqlAst.Statement.Exec) {
            visitStatementExec(node)
            walkSymbolPrimitive(node.procedureName)
            node.args.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkStatementExplain(node: PartiqlAst.Statement.Explain) {
            visitStatementExplain(node)
            walkExplainTarget(node.target)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: ExplainTarget
        //////////////////////////////////////
        open fun walkExplainTarget(node: PartiqlAst.ExplainTarget) {
            visitExplainTarget(node)
            when(node) {
                is PartiqlAst.ExplainTarget.Domain -> walkExplainTargetDomain(node)
            }
        }
    
        open fun walkExplainTargetDomain(node: PartiqlAst.ExplainTarget.Domain) {
            visitExplainTargetDomain(node)
            walkStatement(node.statement)
            node.type?.let { walkSymbolPrimitive(it) }
            node.format?.let { walkSymbolPrimitive(it) }
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: Expr
        //////////////////////////////////////
        open fun walkExpr(node: PartiqlAst.Expr) {
            visitExpr(node)
            when(node) {
                is PartiqlAst.Expr.Missing -> walkExprMissing(node)
                is PartiqlAst.Expr.Lit -> walkExprLit(node)
                is PartiqlAst.Expr.Id -> walkExprId(node)
                is PartiqlAst.Expr.Parameter -> walkExprParameter(node)
                is PartiqlAst.Expr.Not -> walkExprNot(node)
                is PartiqlAst.Expr.Pos -> walkExprPos(node)
                is PartiqlAst.Expr.Neg -> walkExprNeg(node)
                is PartiqlAst.Expr.Plus -> walkExprPlus(node)
                is PartiqlAst.Expr.Minus -> walkExprMinus(node)
                is PartiqlAst.Expr.Times -> walkExprTimes(node)
                is PartiqlAst.Expr.Divide -> walkExprDivide(node)
                is PartiqlAst.Expr.Modulo -> walkExprModulo(node)
                is PartiqlAst.Expr.Concat -> walkExprConcat(node)
                is PartiqlAst.Expr.And -> walkExprAnd(node)
                is PartiqlAst.Expr.Or -> walkExprOr(node)
                is PartiqlAst.Expr.Eq -> walkExprEq(node)
                is PartiqlAst.Expr.Ne -> walkExprNe(node)
                is PartiqlAst.Expr.Gt -> walkExprGt(node)
                is PartiqlAst.Expr.Gte -> walkExprGte(node)
                is PartiqlAst.Expr.Lt -> walkExprLt(node)
                is PartiqlAst.Expr.Lte -> walkExprLte(node)
                is PartiqlAst.Expr.Like -> walkExprLike(node)
                is PartiqlAst.Expr.Between -> walkExprBetween(node)
                is PartiqlAst.Expr.InCollection -> walkExprInCollection(node)
                is PartiqlAst.Expr.IsType -> walkExprIsType(node)
                is PartiqlAst.Expr.SimpleCase -> walkExprSimpleCase(node)
                is PartiqlAst.Expr.SearchedCase -> walkExprSearchedCase(node)
                is PartiqlAst.Expr.Struct -> walkExprStruct(node)
                is PartiqlAst.Expr.Bag -> walkExprBag(node)
                is PartiqlAst.Expr.List -> walkExprList(node)
                is PartiqlAst.Expr.Sexp -> walkExprSexp(node)
                is PartiqlAst.Expr.Date -> walkExprDate(node)
                is PartiqlAst.Expr.LitTime -> walkExprLitTime(node)
                is PartiqlAst.Expr.BagOp -> walkExprBagOp(node)
                is PartiqlAst.Expr.GraphMatch -> walkExprGraphMatch(node)
                is PartiqlAst.Expr.Path -> walkExprPath(node)
                is PartiqlAst.Expr.Call -> walkExprCall(node)
                is PartiqlAst.Expr.CallAgg -> walkExprCallAgg(node)
                is PartiqlAst.Expr.CallWindow -> walkExprCallWindow(node)
                is PartiqlAst.Expr.Cast -> walkExprCast(node)
                is PartiqlAst.Expr.CanCast -> walkExprCanCast(node)
                is PartiqlAst.Expr.CanLosslessCast -> walkExprCanLosslessCast(node)
                is PartiqlAst.Expr.NullIf -> walkExprNullIf(node)
                is PartiqlAst.Expr.Coalesce -> walkExprCoalesce(node)
                is PartiqlAst.Expr.Select -> walkExprSelect(node)
            }
        }
    
        open fun walkExprMissing(node: PartiqlAst.Expr.Missing) {
            visitExprMissing(node)
            walkMetas(node.metas)
        }
        open fun walkExprLit(node: PartiqlAst.Expr.Lit) {
            visitExprLit(node)
            walkAnyElement(node.value)
            walkMetas(node.metas)
        }
        open fun walkExprId(node: PartiqlAst.Expr.Id) {
            visitExprId(node)
            walkSymbolPrimitive(node.name)
            walkCaseSensitivity(node.case)
            walkScopeQualifier(node.qualifier)
            walkMetas(node.metas)
        }
        open fun walkExprParameter(node: PartiqlAst.Expr.Parameter) {
            visitExprParameter(node)
            walkLongPrimitive(node.index)
            walkMetas(node.metas)
        }
        open fun walkExprNot(node: PartiqlAst.Expr.Not) {
            visitExprNot(node)
            walkExpr(node.expr)
            walkMetas(node.metas)
        }
        open fun walkExprPos(node: PartiqlAst.Expr.Pos) {
            visitExprPos(node)
            walkExpr(node.expr)
            walkMetas(node.metas)
        }
        open fun walkExprNeg(node: PartiqlAst.Expr.Neg) {
            visitExprNeg(node)
            walkExpr(node.expr)
            walkMetas(node.metas)
        }
        open fun walkExprPlus(node: PartiqlAst.Expr.Plus) {
            visitExprPlus(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprMinus(node: PartiqlAst.Expr.Minus) {
            visitExprMinus(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprTimes(node: PartiqlAst.Expr.Times) {
            visitExprTimes(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprDivide(node: PartiqlAst.Expr.Divide) {
            visitExprDivide(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprModulo(node: PartiqlAst.Expr.Modulo) {
            visitExprModulo(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprConcat(node: PartiqlAst.Expr.Concat) {
            visitExprConcat(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprAnd(node: PartiqlAst.Expr.And) {
            visitExprAnd(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprOr(node: PartiqlAst.Expr.Or) {
            visitExprOr(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprEq(node: PartiqlAst.Expr.Eq) {
            visitExprEq(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprNe(node: PartiqlAst.Expr.Ne) {
            visitExprNe(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprGt(node: PartiqlAst.Expr.Gt) {
            visitExprGt(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprGte(node: PartiqlAst.Expr.Gte) {
            visitExprGte(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprLt(node: PartiqlAst.Expr.Lt) {
            visitExprLt(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprLte(node: PartiqlAst.Expr.Lte) {
            visitExprLte(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprLike(node: PartiqlAst.Expr.Like) {
            visitExprLike(node)
            walkExpr(node.value)
            walkExpr(node.pattern)
            node.escape?.let { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprBetween(node: PartiqlAst.Expr.Between) {
            visitExprBetween(node)
            walkExpr(node.value)
            walkExpr(node.from)
            walkExpr(node.to)
            walkMetas(node.metas)
        }
        open fun walkExprInCollection(node: PartiqlAst.Expr.InCollection) {
            visitExprInCollection(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprIsType(node: PartiqlAst.Expr.IsType) {
            visitExprIsType(node)
            walkExpr(node.value)
            walkType(node.type)
            walkMetas(node.metas)
        }
        open fun walkExprSimpleCase(node: PartiqlAst.Expr.SimpleCase) {
            visitExprSimpleCase(node)
            walkExpr(node.expr)
            walkExprPairList(node.cases)
            node.default?.let { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprSearchedCase(node: PartiqlAst.Expr.SearchedCase) {
            visitExprSearchedCase(node)
            walkExprPairList(node.cases)
            node.default?.let { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprStruct(node: PartiqlAst.Expr.Struct) {
            visitExprStruct(node)
            node.fields.map { walkExprPair(it) }
            walkMetas(node.metas)
        }
        open fun walkExprBag(node: PartiqlAst.Expr.Bag) {
            visitExprBag(node)
            node.values.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprList(node: PartiqlAst.Expr.List) {
            visitExprList(node)
            node.values.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprSexp(node: PartiqlAst.Expr.Sexp) {
            visitExprSexp(node)
            node.values.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprDate(node: PartiqlAst.Expr.Date) {
            visitExprDate(node)
            walkLongPrimitive(node.year)
            walkLongPrimitive(node.month)
            walkLongPrimitive(node.day)
            walkMetas(node.metas)
        }
        open fun walkExprLitTime(node: PartiqlAst.Expr.LitTime) {
            visitExprLitTime(node)
            walkTimeValue(node.value)
            walkMetas(node.metas)
        }
        open fun walkExprBagOp(node: PartiqlAst.Expr.BagOp) {
            visitExprBagOp(node)
            walkBagOpType(node.op)
            walkSetQuantifier(node.quantifier)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprGraphMatch(node: PartiqlAst.Expr.GraphMatch) {
            visitExprGraphMatch(node)
            walkExpr(node.expr)
            walkGpmlPattern(node.gpmlPattern)
            walkMetas(node.metas)
        }
        open fun walkExprPath(node: PartiqlAst.Expr.Path) {
            visitExprPath(node)
            walkExpr(node.root)
            node.steps.map { walkPathStep(it) }
            walkMetas(node.metas)
        }
        open fun walkExprCall(node: PartiqlAst.Expr.Call) {
            visitExprCall(node)
            walkSymbolPrimitive(node.funcName)
            node.args.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprCallAgg(node: PartiqlAst.Expr.CallAgg) {
            visitExprCallAgg(node)
            walkSetQuantifier(node.setq)
            walkSymbolPrimitive(node.funcName)
            walkExpr(node.arg)
            walkMetas(node.metas)
        }
        open fun walkExprCallWindow(node: PartiqlAst.Expr.CallWindow) {
            visitExprCallWindow(node)
            walkSymbolPrimitive(node.funcName)
            walkOver(node.over)
            node.args.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprCast(node: PartiqlAst.Expr.Cast) {
            visitExprCast(node)
            walkExpr(node.value)
            walkType(node.asType)
            walkMetas(node.metas)
        }
        open fun walkExprCanCast(node: PartiqlAst.Expr.CanCast) {
            visitExprCanCast(node)
            walkExpr(node.value)
            walkType(node.asType)
            walkMetas(node.metas)
        }
        open fun walkExprCanLosslessCast(node: PartiqlAst.Expr.CanLosslessCast) {
            visitExprCanLosslessCast(node)
            walkExpr(node.value)
            walkType(node.asType)
            walkMetas(node.metas)
        }
        open fun walkExprNullIf(node: PartiqlAst.Expr.NullIf) {
            visitExprNullIf(node)
            walkExpr(node.expr1)
            walkExpr(node.expr2)
            walkMetas(node.metas)
        }
        open fun walkExprCoalesce(node: PartiqlAst.Expr.Coalesce) {
            visitExprCoalesce(node)
            node.args.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprSelect(node: PartiqlAst.Expr.Select) {
            visitExprSelect(node)
            node.setq?.let { walkSetQuantifier(it) }
            walkProjection(node.project)
            walkFromSource(node.from)
            node.fromLet?.let { walkLet(it) }
            node.where?.let { walkExpr(it) }
            node.group?.let { walkGroupBy(it) }
            node.having?.let { walkExpr(it) }
            node.order?.let { walkOrderBy(it) }
            node.limit?.let { walkExpr(it) }
            node.offset?.let { walkExpr(it) }
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: PathStep
        //////////////////////////////////////
        open fun walkPathStep(node: PartiqlAst.PathStep) {
            visitPathStep(node)
            when(node) {
                is PartiqlAst.PathStep.PathExpr -> walkPathStepPathExpr(node)
                is PartiqlAst.PathStep.PathWildcard -> walkPathStepPathWildcard(node)
                is PartiqlAst.PathStep.PathUnpivot -> walkPathStepPathUnpivot(node)
            }
        }
    
        open fun walkPathStepPathExpr(node: PartiqlAst.PathStep.PathExpr) {
            visitPathStepPathExpr(node)
            walkExpr(node.index)
            walkCaseSensitivity(node.case)
            walkMetas(node.metas)
        }
        open fun walkPathStepPathWildcard(node: PartiqlAst.PathStep.PathWildcard) {
            visitPathStepPathWildcard(node)
            walkMetas(node.metas)
        }
        open fun walkPathStepPathUnpivot(node: PartiqlAst.PathStep.PathUnpivot) {
            visitPathStepPathUnpivot(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: Projection
        //////////////////////////////////////
        open fun walkProjection(node: PartiqlAst.Projection) {
            visitProjection(node)
            when(node) {
                is PartiqlAst.Projection.ProjectStar -> walkProjectionProjectStar(node)
                is PartiqlAst.Projection.ProjectList -> walkProjectionProjectList(node)
                is PartiqlAst.Projection.ProjectPivot -> walkProjectionProjectPivot(node)
                is PartiqlAst.Projection.ProjectValue -> walkProjectionProjectValue(node)
            }
        }
    
        open fun walkProjectionProjectStar(node: PartiqlAst.Projection.ProjectStar) {
            visitProjectionProjectStar(node)
            walkMetas(node.metas)
        }
        open fun walkProjectionProjectList(node: PartiqlAst.Projection.ProjectList) {
            visitProjectionProjectList(node)
            node.projectItems.map { walkProjectItem(it) }
            walkMetas(node.metas)
        }
        open fun walkProjectionProjectPivot(node: PartiqlAst.Projection.ProjectPivot) {
            visitProjectionProjectPivot(node)
            walkExpr(node.value)
            walkExpr(node.key)
            walkMetas(node.metas)
        }
        open fun walkProjectionProjectValue(node: PartiqlAst.Projection.ProjectValue) {
            visitProjectionProjectValue(node)
            walkExpr(node.value)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: ProjectItem
        //////////////////////////////////////
        open fun walkProjectItem(node: PartiqlAst.ProjectItem) {
            visitProjectItem(node)
            when(node) {
                is PartiqlAst.ProjectItem.ProjectAll -> walkProjectItemProjectAll(node)
                is PartiqlAst.ProjectItem.ProjectExpr -> walkProjectItemProjectExpr(node)
            }
        }
    
        open fun walkProjectItemProjectAll(node: PartiqlAst.ProjectItem.ProjectAll) {
            visitProjectItemProjectAll(node)
            walkExpr(node.expr)
            walkMetas(node.metas)
        }
        open fun walkProjectItemProjectExpr(node: PartiqlAst.ProjectItem.ProjectExpr) {
            visitProjectItemProjectExpr(node)
            walkExpr(node.expr)
            node.asAlias?.let { walkSymbolPrimitive(it) }
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: FromSource
        //////////////////////////////////////
        open fun walkFromSource(node: PartiqlAst.FromSource) {
            visitFromSource(node)
            when(node) {
                is PartiqlAst.FromSource.Scan -> walkFromSourceScan(node)
                is PartiqlAst.FromSource.Unpivot -> walkFromSourceUnpivot(node)
                is PartiqlAst.FromSource.Join -> walkFromSourceJoin(node)
            }
        }
    
        open fun walkFromSourceScan(node: PartiqlAst.FromSource.Scan) {
            visitFromSourceScan(node)
            walkExpr(node.expr)
            node.asAlias?.let { walkSymbolPrimitive(it) }
            node.atAlias?.let { walkSymbolPrimitive(it) }
            node.byAlias?.let { walkSymbolPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkFromSourceUnpivot(node: PartiqlAst.FromSource.Unpivot) {
            visitFromSourceUnpivot(node)
            walkExpr(node.expr)
            node.asAlias?.let { walkSymbolPrimitive(it) }
            node.atAlias?.let { walkSymbolPrimitive(it) }
            node.byAlias?.let { walkSymbolPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkFromSourceJoin(node: PartiqlAst.FromSource.Join) {
            visitFromSourceJoin(node)
            walkJoinType(node.type)
            walkFromSource(node.left)
            walkFromSource(node.right)
            node.predicate?.let { walkExpr(it) }
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: JoinType
        //////////////////////////////////////
        open fun walkJoinType(node: PartiqlAst.JoinType) {
            visitJoinType(node)
            when(node) {
                is PartiqlAst.JoinType.Inner -> walkJoinTypeInner(node)
                is PartiqlAst.JoinType.Left -> walkJoinTypeLeft(node)
                is PartiqlAst.JoinType.Right -> walkJoinTypeRight(node)
                is PartiqlAst.JoinType.Full -> walkJoinTypeFull(node)
            }
        }
    
        open fun walkJoinTypeInner(node: PartiqlAst.JoinType.Inner) {
            visitJoinTypeInner(node)
            walkMetas(node.metas)
        }
        open fun walkJoinTypeLeft(node: PartiqlAst.JoinType.Left) {
            visitJoinTypeLeft(node)
            walkMetas(node.metas)
        }
        open fun walkJoinTypeRight(node: PartiqlAst.JoinType.Right) {
            visitJoinTypeRight(node)
            walkMetas(node.metas)
        }
        open fun walkJoinTypeFull(node: PartiqlAst.JoinType.Full) {
            visitJoinTypeFull(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: GraphMatchDirection
        //////////////////////////////////////
        open fun walkGraphMatchDirection(node: PartiqlAst.GraphMatchDirection) {
            visitGraphMatchDirection(node)
            when(node) {
                is PartiqlAst.GraphMatchDirection.EdgeLeft -> walkGraphMatchDirectionEdgeLeft(node)
                is PartiqlAst.GraphMatchDirection.EdgeUndirected -> walkGraphMatchDirectionEdgeUndirected(node)
                is PartiqlAst.GraphMatchDirection.EdgeRight -> walkGraphMatchDirectionEdgeRight(node)
                is PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected -> walkGraphMatchDirectionEdgeLeftOrUndirected(node)
                is PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight -> walkGraphMatchDirectionEdgeUndirectedOrRight(node)
                is PartiqlAst.GraphMatchDirection.EdgeLeftOrRight -> walkGraphMatchDirectionEdgeLeftOrRight(node)
                is PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight -> walkGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node)
            }
        }
    
        open fun walkGraphMatchDirectionEdgeLeft(node: PartiqlAst.GraphMatchDirection.EdgeLeft) {
            visitGraphMatchDirectionEdgeLeft(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchDirectionEdgeUndirected(node: PartiqlAst.GraphMatchDirection.EdgeUndirected) {
            visitGraphMatchDirectionEdgeUndirected(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchDirectionEdgeRight(node: PartiqlAst.GraphMatchDirection.EdgeRight) {
            visitGraphMatchDirectionEdgeRight(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchDirectionEdgeLeftOrUndirected(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected) {
            visitGraphMatchDirectionEdgeLeftOrUndirected(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchDirectionEdgeUndirectedOrRight(node: PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight) {
            visitGraphMatchDirectionEdgeUndirectedOrRight(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchDirectionEdgeLeftOrRight(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrRight) {
            visitGraphMatchDirectionEdgeLeftOrRight(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight) {
            visitGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: GraphMatchPatternPart
        //////////////////////////////////////
        open fun walkGraphMatchPatternPart(node: PartiqlAst.GraphMatchPatternPart) {
            visitGraphMatchPatternPart(node)
            when(node) {
                is PartiqlAst.GraphMatchPatternPart.Node -> walkGraphMatchPatternPartNode(node)
                is PartiqlAst.GraphMatchPatternPart.Edge -> walkGraphMatchPatternPartEdge(node)
                is PartiqlAst.GraphMatchPatternPart.Pattern -> walkGraphMatchPatternPartPattern(node)
            }
        }
    
        open fun walkGraphMatchPatternPartNode(node: PartiqlAst.GraphMatchPatternPart.Node) {
            visitGraphMatchPatternPartNode(node)
            node.prefilter?.let { walkExpr(it) }
            node.variable?.let { walkSymbolPrimitive(it) }
            node.label.map { walkSymbolPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkGraphMatchPatternPartEdge(node: PartiqlAst.GraphMatchPatternPart.Edge) {
            visitGraphMatchPatternPartEdge(node)
            walkGraphMatchDirection(node.direction)
            node.quantifier?.let { walkGraphMatchQuantifier(it) }
            node.prefilter?.let { walkExpr(it) }
            node.variable?.let { walkSymbolPrimitive(it) }
            node.label.map { walkSymbolPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkGraphMatchPatternPartPattern(node: PartiqlAst.GraphMatchPatternPart.Pattern) {
            visitGraphMatchPatternPartPattern(node)
            walkGraphMatchPattern(node.pattern)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: GraphMatchRestrictor
        //////////////////////////////////////
        open fun walkGraphMatchRestrictor(node: PartiqlAst.GraphMatchRestrictor) {
            visitGraphMatchRestrictor(node)
            when(node) {
                is PartiqlAst.GraphMatchRestrictor.RestrictorTrail -> walkGraphMatchRestrictorRestrictorTrail(node)
                is PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic -> walkGraphMatchRestrictorRestrictorAcyclic(node)
                is PartiqlAst.GraphMatchRestrictor.RestrictorSimple -> walkGraphMatchRestrictorRestrictorSimple(node)
            }
        }
    
        open fun walkGraphMatchRestrictorRestrictorTrail(node: PartiqlAst.GraphMatchRestrictor.RestrictorTrail) {
            visitGraphMatchRestrictorRestrictorTrail(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchRestrictorRestrictorAcyclic(node: PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic) {
            visitGraphMatchRestrictorRestrictorAcyclic(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchRestrictorRestrictorSimple(node: PartiqlAst.GraphMatchRestrictor.RestrictorSimple) {
            visitGraphMatchRestrictorRestrictorSimple(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: GraphMatchSelector
        //////////////////////////////////////
        open fun walkGraphMatchSelector(node: PartiqlAst.GraphMatchSelector) {
            visitGraphMatchSelector(node)
            when(node) {
                is PartiqlAst.GraphMatchSelector.SelectorAnyShortest -> walkGraphMatchSelectorSelectorAnyShortest(node)
                is PartiqlAst.GraphMatchSelector.SelectorAllShortest -> walkGraphMatchSelectorSelectorAllShortest(node)
                is PartiqlAst.GraphMatchSelector.SelectorAny -> walkGraphMatchSelectorSelectorAny(node)
                is PartiqlAst.GraphMatchSelector.SelectorAnyK -> walkGraphMatchSelectorSelectorAnyK(node)
                is PartiqlAst.GraphMatchSelector.SelectorShortestK -> walkGraphMatchSelectorSelectorShortestK(node)
                is PartiqlAst.GraphMatchSelector.SelectorShortestKGroup -> walkGraphMatchSelectorSelectorShortestKGroup(node)
            }
        }
    
        open fun walkGraphMatchSelectorSelectorAnyShortest(node: PartiqlAst.GraphMatchSelector.SelectorAnyShortest) {
            visitGraphMatchSelectorSelectorAnyShortest(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchSelectorSelectorAllShortest(node: PartiqlAst.GraphMatchSelector.SelectorAllShortest) {
            visitGraphMatchSelectorSelectorAllShortest(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchSelectorSelectorAny(node: PartiqlAst.GraphMatchSelector.SelectorAny) {
            visitGraphMatchSelectorSelectorAny(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchSelectorSelectorAnyK(node: PartiqlAst.GraphMatchSelector.SelectorAnyK) {
            visitGraphMatchSelectorSelectorAnyK(node)
            walkLongPrimitive(node.k)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchSelectorSelectorShortestK(node: PartiqlAst.GraphMatchSelector.SelectorShortestK) {
            visitGraphMatchSelectorSelectorShortestK(node)
            walkLongPrimitive(node.k)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchSelectorSelectorShortestKGroup(node: PartiqlAst.GraphMatchSelector.SelectorShortestKGroup) {
            visitGraphMatchSelectorSelectorShortestKGroup(node)
            walkLongPrimitive(node.k)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: GroupingStrategy
        //////////////////////////////////////
        open fun walkGroupingStrategy(node: PartiqlAst.GroupingStrategy) {
            visitGroupingStrategy(node)
            when(node) {
                is PartiqlAst.GroupingStrategy.GroupFull -> walkGroupingStrategyGroupFull(node)
                is PartiqlAst.GroupingStrategy.GroupPartial -> walkGroupingStrategyGroupPartial(node)
            }
        }
    
        open fun walkGroupingStrategyGroupFull(node: PartiqlAst.GroupingStrategy.GroupFull) {
            visitGroupingStrategyGroupFull(node)
            walkMetas(node.metas)
        }
        open fun walkGroupingStrategyGroupPartial(node: PartiqlAst.GroupingStrategy.GroupPartial) {
            visitGroupingStrategyGroupPartial(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: OrderingSpec
        //////////////////////////////////////
        open fun walkOrderingSpec(node: PartiqlAst.OrderingSpec) {
            visitOrderingSpec(node)
            when(node) {
                is PartiqlAst.OrderingSpec.Asc -> walkOrderingSpecAsc(node)
                is PartiqlAst.OrderingSpec.Desc -> walkOrderingSpecDesc(node)
            }
        }
    
        open fun walkOrderingSpecAsc(node: PartiqlAst.OrderingSpec.Asc) {
            visitOrderingSpecAsc(node)
            walkMetas(node.metas)
        }
        open fun walkOrderingSpecDesc(node: PartiqlAst.OrderingSpec.Desc) {
            visitOrderingSpecDesc(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: NullsSpec
        //////////////////////////////////////
        open fun walkNullsSpec(node: PartiqlAst.NullsSpec) {
            visitNullsSpec(node)
            when(node) {
                is PartiqlAst.NullsSpec.NullsFirst -> walkNullsSpecNullsFirst(node)
                is PartiqlAst.NullsSpec.NullsLast -> walkNullsSpecNullsLast(node)
            }
        }
    
        open fun walkNullsSpecNullsFirst(node: PartiqlAst.NullsSpec.NullsFirst) {
            visitNullsSpecNullsFirst(node)
            walkMetas(node.metas)
        }
        open fun walkNullsSpecNullsLast(node: PartiqlAst.NullsSpec.NullsLast) {
            visitNullsSpecNullsLast(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: CaseSensitivity
        //////////////////////////////////////
        open fun walkCaseSensitivity(node: PartiqlAst.CaseSensitivity) {
            visitCaseSensitivity(node)
            when(node) {
                is PartiqlAst.CaseSensitivity.CaseSensitive -> walkCaseSensitivityCaseSensitive(node)
                is PartiqlAst.CaseSensitivity.CaseInsensitive -> walkCaseSensitivityCaseInsensitive(node)
            }
        }
    
        open fun walkCaseSensitivityCaseSensitive(node: PartiqlAst.CaseSensitivity.CaseSensitive) {
            visitCaseSensitivityCaseSensitive(node)
            walkMetas(node.metas)
        }
        open fun walkCaseSensitivityCaseInsensitive(node: PartiqlAst.CaseSensitivity.CaseInsensitive) {
            visitCaseSensitivityCaseInsensitive(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: ScopeQualifier
        //////////////////////////////////////
        open fun walkScopeQualifier(node: PartiqlAst.ScopeQualifier) {
            visitScopeQualifier(node)
            when(node) {
                is PartiqlAst.ScopeQualifier.Unqualified -> walkScopeQualifierUnqualified(node)
                is PartiqlAst.ScopeQualifier.LocalsFirst -> walkScopeQualifierLocalsFirst(node)
            }
        }
    
        open fun walkScopeQualifierUnqualified(node: PartiqlAst.ScopeQualifier.Unqualified) {
            visitScopeQualifierUnqualified(node)
            walkMetas(node.metas)
        }
        open fun walkScopeQualifierLocalsFirst(node: PartiqlAst.ScopeQualifier.LocalsFirst) {
            visitScopeQualifierLocalsFirst(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: SetQuantifier
        //////////////////////////////////////
        open fun walkSetQuantifier(node: PartiqlAst.SetQuantifier) {
            visitSetQuantifier(node)
            when(node) {
                is PartiqlAst.SetQuantifier.All -> walkSetQuantifierAll(node)
                is PartiqlAst.SetQuantifier.Distinct -> walkSetQuantifierDistinct(node)
            }
        }
    
        open fun walkSetQuantifierAll(node: PartiqlAst.SetQuantifier.All) {
            visitSetQuantifierAll(node)
            walkMetas(node.metas)
        }
        open fun walkSetQuantifierDistinct(node: PartiqlAst.SetQuantifier.Distinct) {
            visitSetQuantifierDistinct(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: BagOpType
        //////////////////////////////////////
        open fun walkBagOpType(node: PartiqlAst.BagOpType) {
            visitBagOpType(node)
            when(node) {
                is PartiqlAst.BagOpType.Union -> walkBagOpTypeUnion(node)
                is PartiqlAst.BagOpType.Intersect -> walkBagOpTypeIntersect(node)
                is PartiqlAst.BagOpType.Except -> walkBagOpTypeExcept(node)
                is PartiqlAst.BagOpType.OuterUnion -> walkBagOpTypeOuterUnion(node)
                is PartiqlAst.BagOpType.OuterIntersect -> walkBagOpTypeOuterIntersect(node)
                is PartiqlAst.BagOpType.OuterExcept -> walkBagOpTypeOuterExcept(node)
            }
        }
    
        open fun walkBagOpTypeUnion(node: PartiqlAst.BagOpType.Union) {
            visitBagOpTypeUnion(node)
            walkMetas(node.metas)
        }
        open fun walkBagOpTypeIntersect(node: PartiqlAst.BagOpType.Intersect) {
            visitBagOpTypeIntersect(node)
            walkMetas(node.metas)
        }
        open fun walkBagOpTypeExcept(node: PartiqlAst.BagOpType.Except) {
            visitBagOpTypeExcept(node)
            walkMetas(node.metas)
        }
        open fun walkBagOpTypeOuterUnion(node: PartiqlAst.BagOpType.OuterUnion) {
            visitBagOpTypeOuterUnion(node)
            walkMetas(node.metas)
        }
        open fun walkBagOpTypeOuterIntersect(node: PartiqlAst.BagOpType.OuterIntersect) {
            visitBagOpTypeOuterIntersect(node)
            walkMetas(node.metas)
        }
        open fun walkBagOpTypeOuterExcept(node: PartiqlAst.BagOpType.OuterExcept) {
            visitBagOpTypeOuterExcept(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: DmlOp
        //////////////////////////////////////
        open fun walkDmlOp(node: PartiqlAst.DmlOp) {
            visitDmlOp(node)
            when(node) {
                is PartiqlAst.DmlOp.Insert -> walkDmlOpInsert(node)
                is PartiqlAst.DmlOp.InsertValue -> walkDmlOpInsertValue(node)
                is PartiqlAst.DmlOp.Set -> walkDmlOpSet(node)
                is PartiqlAst.DmlOp.Remove -> walkDmlOpRemove(node)
                is PartiqlAst.DmlOp.Delete -> walkDmlOpDelete(node)
            }
        }
    
        open fun walkDmlOpInsert(node: PartiqlAst.DmlOp.Insert) {
            visitDmlOpInsert(node)
            walkExpr(node.target)
            walkExpr(node.values)
            node.conflictAction?.let { walkConflictAction(it) }
            walkMetas(node.metas)
        }
        open fun walkDmlOpInsertValue(node: PartiqlAst.DmlOp.InsertValue) {
            visitDmlOpInsertValue(node)
            walkExpr(node.target)
            walkExpr(node.value)
            node.index?.let { walkExpr(it) }
            node.onConflict?.let { walkOnConflict(it) }
            walkMetas(node.metas)
        }
        open fun walkDmlOpSet(node: PartiqlAst.DmlOp.Set) {
            visitDmlOpSet(node)
            walkAssignment(node.assignment)
            walkMetas(node.metas)
        }
        open fun walkDmlOpRemove(node: PartiqlAst.DmlOp.Remove) {
            visitDmlOpRemove(node)
            walkExpr(node.target)
            walkMetas(node.metas)
        }
        open fun walkDmlOpDelete(node: PartiqlAst.DmlOp.Delete) {
            visitDmlOpDelete(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: ConflictAction
        //////////////////////////////////////
        open fun walkConflictAction(node: PartiqlAst.ConflictAction) {
            visitConflictAction(node)
            when(node) {
                is PartiqlAst.ConflictAction.DoReplace -> walkConflictActionDoReplace(node)
                is PartiqlAst.ConflictAction.DoUpdate -> walkConflictActionDoUpdate(node)
                is PartiqlAst.ConflictAction.DoNothing -> walkConflictActionDoNothing(node)
            }
        }
    
        open fun walkConflictActionDoReplace(node: PartiqlAst.ConflictAction.DoReplace) {
            visitConflictActionDoReplace(node)
            walkOnConflictValue(node.value)
            walkMetas(node.metas)
        }
        open fun walkConflictActionDoUpdate(node: PartiqlAst.ConflictAction.DoUpdate) {
            visitConflictActionDoUpdate(node)
            walkOnConflictValue(node.value)
            walkMetas(node.metas)
        }
        open fun walkConflictActionDoNothing(node: PartiqlAst.ConflictAction.DoNothing) {
            visitConflictActionDoNothing(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: OnConflictValue
        //////////////////////////////////////
        open fun walkOnConflictValue(node: PartiqlAst.OnConflictValue) {
            visitOnConflictValue(node)
            when(node) {
                is PartiqlAst.OnConflictValue.Excluded -> walkOnConflictValueExcluded(node)
            }
        }
    
        open fun walkOnConflictValueExcluded(node: PartiqlAst.OnConflictValue.Excluded) {
            visitOnConflictValueExcluded(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: DdlOp
        //////////////////////////////////////
        open fun walkDdlOp(node: PartiqlAst.DdlOp) {
            visitDdlOp(node)
            when(node) {
                is PartiqlAst.DdlOp.CreateTable -> walkDdlOpCreateTable(node)
                is PartiqlAst.DdlOp.DropTable -> walkDdlOpDropTable(node)
                is PartiqlAst.DdlOp.CreateIndex -> walkDdlOpCreateIndex(node)
                is PartiqlAst.DdlOp.DropIndex -> walkDdlOpDropIndex(node)
            }
        }
    
        open fun walkDdlOpCreateTable(node: PartiqlAst.DdlOp.CreateTable) {
            visitDdlOpCreateTable(node)
            walkSymbolPrimitive(node.tableName)
            walkMetas(node.metas)
        }
        open fun walkDdlOpDropTable(node: PartiqlAst.DdlOp.DropTable) {
            visitDdlOpDropTable(node)
            walkIdentifier(node.tableName)
            walkMetas(node.metas)
        }
        open fun walkDdlOpCreateIndex(node: PartiqlAst.DdlOp.CreateIndex) {
            visitDdlOpCreateIndex(node)
            walkIdentifier(node.indexName)
            node.fields.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkDdlOpDropIndex(node: PartiqlAst.DdlOp.DropIndex) {
            visitDdlOpDropIndex(node)
            walkIdentifier(node.table)
            walkIdentifier(node.keys)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: ColumnComponent
        //////////////////////////////////////
        open fun walkColumnComponent(node: PartiqlAst.ColumnComponent) {
            visitColumnComponent(node)
            when(node) {
                is PartiqlAst.ColumnComponent.ReturningWildcard -> walkColumnComponentReturningWildcard(node)
                is PartiqlAst.ColumnComponent.ReturningColumn -> walkColumnComponentReturningColumn(node)
            }
        }
    
        open fun walkColumnComponentReturningWildcard(node: PartiqlAst.ColumnComponent.ReturningWildcard) {
            visitColumnComponentReturningWildcard(node)
            walkMetas(node.metas)
        }
        open fun walkColumnComponentReturningColumn(node: PartiqlAst.ColumnComponent.ReturningColumn) {
            visitColumnComponentReturningColumn(node)
            walkExpr(node.expr)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: ReturningMapping
        //////////////////////////////////////
        open fun walkReturningMapping(node: PartiqlAst.ReturningMapping) {
            visitReturningMapping(node)
            when(node) {
                is PartiqlAst.ReturningMapping.ModifiedNew -> walkReturningMappingModifiedNew(node)
                is PartiqlAst.ReturningMapping.ModifiedOld -> walkReturningMappingModifiedOld(node)
                is PartiqlAst.ReturningMapping.AllNew -> walkReturningMappingAllNew(node)
                is PartiqlAst.ReturningMapping.AllOld -> walkReturningMappingAllOld(node)
            }
        }
    
        open fun walkReturningMappingModifiedNew(node: PartiqlAst.ReturningMapping.ModifiedNew) {
            visitReturningMappingModifiedNew(node)
            walkMetas(node.metas)
        }
        open fun walkReturningMappingModifiedOld(node: PartiqlAst.ReturningMapping.ModifiedOld) {
            visitReturningMappingModifiedOld(node)
            walkMetas(node.metas)
        }
        open fun walkReturningMappingAllNew(node: PartiqlAst.ReturningMapping.AllNew) {
            visitReturningMappingAllNew(node)
            walkMetas(node.metas)
        }
        open fun walkReturningMappingAllOld(node: PartiqlAst.ReturningMapping.AllOld) {
            visitReturningMappingAllOld(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: Type
        //////////////////////////////////////
        open fun walkType(node: PartiqlAst.Type) {
            visitType(node)
            when(node) {
                is PartiqlAst.Type.NullType -> walkTypeNullType(node)
                is PartiqlAst.Type.BooleanType -> walkTypeBooleanType(node)
                is PartiqlAst.Type.SmallintType -> walkTypeSmallintType(node)
                is PartiqlAst.Type.Integer4Type -> walkTypeInteger4Type(node)
                is PartiqlAst.Type.Integer8Type -> walkTypeInteger8Type(node)
                is PartiqlAst.Type.IntegerType -> walkTypeIntegerType(node)
                is PartiqlAst.Type.FloatType -> walkTypeFloatType(node)
                is PartiqlAst.Type.RealType -> walkTypeRealType(node)
                is PartiqlAst.Type.DoublePrecisionType -> walkTypeDoublePrecisionType(node)
                is PartiqlAst.Type.DecimalType -> walkTypeDecimalType(node)
                is PartiqlAst.Type.NumericType -> walkTypeNumericType(node)
                is PartiqlAst.Type.TimestampType -> walkTypeTimestampType(node)
                is PartiqlAst.Type.CharacterType -> walkTypeCharacterType(node)
                is PartiqlAst.Type.CharacterVaryingType -> walkTypeCharacterVaryingType(node)
                is PartiqlAst.Type.MissingType -> walkTypeMissingType(node)
                is PartiqlAst.Type.StringType -> walkTypeStringType(node)
                is PartiqlAst.Type.SymbolType -> walkTypeSymbolType(node)
                is PartiqlAst.Type.BlobType -> walkTypeBlobType(node)
                is PartiqlAst.Type.ClobType -> walkTypeClobType(node)
                is PartiqlAst.Type.DateType -> walkTypeDateType(node)
                is PartiqlAst.Type.TimeType -> walkTypeTimeType(node)
                is PartiqlAst.Type.TimeWithTimeZoneType -> walkTypeTimeWithTimeZoneType(node)
                is PartiqlAst.Type.StructType -> walkTypeStructType(node)
                is PartiqlAst.Type.TupleType -> walkTypeTupleType(node)
                is PartiqlAst.Type.ListType -> walkTypeListType(node)
                is PartiqlAst.Type.SexpType -> walkTypeSexpType(node)
                is PartiqlAst.Type.BagType -> walkTypeBagType(node)
                is PartiqlAst.Type.AnyType -> walkTypeAnyType(node)
                is PartiqlAst.Type.CustomType -> walkTypeCustomType(node)
            }
        }
    
        open fun walkTypeNullType(node: PartiqlAst.Type.NullType) {
            visitTypeNullType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeBooleanType(node: PartiqlAst.Type.BooleanType) {
            visitTypeBooleanType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeSmallintType(node: PartiqlAst.Type.SmallintType) {
            visitTypeSmallintType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeInteger4Type(node: PartiqlAst.Type.Integer4Type) {
            visitTypeInteger4Type(node)
            walkMetas(node.metas)
        }
        open fun walkTypeInteger8Type(node: PartiqlAst.Type.Integer8Type) {
            visitTypeInteger8Type(node)
            walkMetas(node.metas)
        }
        open fun walkTypeIntegerType(node: PartiqlAst.Type.IntegerType) {
            visitTypeIntegerType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeFloatType(node: PartiqlAst.Type.FloatType) {
            visitTypeFloatType(node)
            node.precision?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeRealType(node: PartiqlAst.Type.RealType) {
            visitTypeRealType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeDoublePrecisionType(node: PartiqlAst.Type.DoublePrecisionType) {
            visitTypeDoublePrecisionType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeDecimalType(node: PartiqlAst.Type.DecimalType) {
            visitTypeDecimalType(node)
            node.precision?.let { walkLongPrimitive(it) }
            node.scale?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeNumericType(node: PartiqlAst.Type.NumericType) {
            visitTypeNumericType(node)
            node.precision?.let { walkLongPrimitive(it) }
            node.scale?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeTimestampType(node: PartiqlAst.Type.TimestampType) {
            visitTypeTimestampType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeCharacterType(node: PartiqlAst.Type.CharacterType) {
            visitTypeCharacterType(node)
            node.length?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeCharacterVaryingType(node: PartiqlAst.Type.CharacterVaryingType) {
            visitTypeCharacterVaryingType(node)
            node.length?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeMissingType(node: PartiqlAst.Type.MissingType) {
            visitTypeMissingType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeStringType(node: PartiqlAst.Type.StringType) {
            visitTypeStringType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeSymbolType(node: PartiqlAst.Type.SymbolType) {
            visitTypeSymbolType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeBlobType(node: PartiqlAst.Type.BlobType) {
            visitTypeBlobType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeClobType(node: PartiqlAst.Type.ClobType) {
            visitTypeClobType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeDateType(node: PartiqlAst.Type.DateType) {
            visitTypeDateType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeTimeType(node: PartiqlAst.Type.TimeType) {
            visitTypeTimeType(node)
            node.precision?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeTimeWithTimeZoneType(node: PartiqlAst.Type.TimeWithTimeZoneType) {
            visitTypeTimeWithTimeZoneType(node)
            node.precision?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeStructType(node: PartiqlAst.Type.StructType) {
            visitTypeStructType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeTupleType(node: PartiqlAst.Type.TupleType) {
            visitTypeTupleType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeListType(node: PartiqlAst.Type.ListType) {
            visitTypeListType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeSexpType(node: PartiqlAst.Type.SexpType) {
            visitTypeSexpType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeBagType(node: PartiqlAst.Type.BagType) {
            visitTypeBagType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeAnyType(node: PartiqlAst.Type.AnyType) {
            visitTypeAnyType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeCustomType(node: PartiqlAst.Type.CustomType) {
            visitTypeCustomType(node)
            walkSymbolPrimitive(node.name)
            walkMetas(node.metas)
        }
    }
    open class VisitorFold : DomainVisitorFoldBase() {
        ////////////////////////////////////////////////////////////////////////////
        // Visit Functions
        ////////////////////////////////////////////////////////////////////////////
    
        //////////////////////////////////////
        // Tuple Types
        //////////////////////////////////////
        open protected fun visitTimeValue(node: PartiqlAst.TimeValue, accumulator: T): T = accumulator
        open protected fun visitLet(node: PartiqlAst.Let, accumulator: T): T = accumulator
        open protected fun visitLetBinding(node: PartiqlAst.LetBinding, accumulator: T): T = accumulator
        open protected fun visitGraphMatchQuantifier(node: PartiqlAst.GraphMatchQuantifier, accumulator: T): T = accumulator
        open protected fun visitGraphMatchPattern(node: PartiqlAst.GraphMatchPattern, accumulator: T): T = accumulator
        open protected fun visitGpmlPattern(node: PartiqlAst.GpmlPattern, accumulator: T): T = accumulator
        open protected fun visitExprPair(node: PartiqlAst.ExprPair, accumulator: T): T = accumulator
        open protected fun visitExprPairList(node: PartiqlAst.ExprPairList, accumulator: T): T = accumulator
        open protected fun visitGroupBy(node: PartiqlAst.GroupBy, accumulator: T): T = accumulator
        open protected fun visitGroupKeyList(node: PartiqlAst.GroupKeyList, accumulator: T): T = accumulator
        open protected fun visitGroupKey(node: PartiqlAst.GroupKey, accumulator: T): T = accumulator
        open protected fun visitOrderBy(node: PartiqlAst.OrderBy, accumulator: T): T = accumulator
        open protected fun visitSortSpec(node: PartiqlAst.SortSpec, accumulator: T): T = accumulator
        open protected fun visitOver(node: PartiqlAst.Over, accumulator: T): T = accumulator
        open protected fun visitWindowPartitionList(node: PartiqlAst.WindowPartitionList, accumulator: T): T = accumulator
        open protected fun visitWindowSortSpecList(node: PartiqlAst.WindowSortSpecList, accumulator: T): T = accumulator
        open protected fun visitDmlOpList(node: PartiqlAst.DmlOpList, accumulator: T): T = accumulator
        open protected fun visitOnConflict(node: PartiqlAst.OnConflict, accumulator: T): T = accumulator
        open protected fun visitReturningExpr(node: PartiqlAst.ReturningExpr, accumulator: T): T = accumulator
        open protected fun visitReturningElem(node: PartiqlAst.ReturningElem, accumulator: T): T = accumulator
        open protected fun visitIdentifier(node: PartiqlAst.Identifier, accumulator: T): T = accumulator
        open protected fun visitAssignment(node: PartiqlAst.Assignment, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: Statement
        //////////////////////////////////////
        open protected fun visitStatement(node: PartiqlAst.Statement, accumulator: T): T = accumulator
        open protected fun visitStatementQuery(node: PartiqlAst.Statement.Query, accumulator: T): T = accumulator
        open protected fun visitStatementDml(node: PartiqlAst.Statement.Dml, accumulator: T): T = accumulator
        open protected fun visitStatementDdl(node: PartiqlAst.Statement.Ddl, accumulator: T): T = accumulator
        open protected fun visitStatementExec(node: PartiqlAst.Statement.Exec, accumulator: T): T = accumulator
        open protected fun visitStatementExplain(node: PartiqlAst.Statement.Explain, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: ExplainTarget
        //////////////////////////////////////
        open protected fun visitExplainTarget(node: PartiqlAst.ExplainTarget, accumulator: T): T = accumulator
        open protected fun visitExplainTargetDomain(node: PartiqlAst.ExplainTarget.Domain, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: Expr
        //////////////////////////////////////
        open protected fun visitExpr(node: PartiqlAst.Expr, accumulator: T): T = accumulator
        open protected fun visitExprMissing(node: PartiqlAst.Expr.Missing, accumulator: T): T = accumulator
        open protected fun visitExprLit(node: PartiqlAst.Expr.Lit, accumulator: T): T = accumulator
        open protected fun visitExprId(node: PartiqlAst.Expr.Id, accumulator: T): T = accumulator
        open protected fun visitExprParameter(node: PartiqlAst.Expr.Parameter, accumulator: T): T = accumulator
        open protected fun visitExprNot(node: PartiqlAst.Expr.Not, accumulator: T): T = accumulator
        open protected fun visitExprPos(node: PartiqlAst.Expr.Pos, accumulator: T): T = accumulator
        open protected fun visitExprNeg(node: PartiqlAst.Expr.Neg, accumulator: T): T = accumulator
        open protected fun visitExprPlus(node: PartiqlAst.Expr.Plus, accumulator: T): T = accumulator
        open protected fun visitExprMinus(node: PartiqlAst.Expr.Minus, accumulator: T): T = accumulator
        open protected fun visitExprTimes(node: PartiqlAst.Expr.Times, accumulator: T): T = accumulator
        open protected fun visitExprDivide(node: PartiqlAst.Expr.Divide, accumulator: T): T = accumulator
        open protected fun visitExprModulo(node: PartiqlAst.Expr.Modulo, accumulator: T): T = accumulator
        open protected fun visitExprConcat(node: PartiqlAst.Expr.Concat, accumulator: T): T = accumulator
        open protected fun visitExprAnd(node: PartiqlAst.Expr.And, accumulator: T): T = accumulator
        open protected fun visitExprOr(node: PartiqlAst.Expr.Or, accumulator: T): T = accumulator
        open protected fun visitExprEq(node: PartiqlAst.Expr.Eq, accumulator: T): T = accumulator
        open protected fun visitExprNe(node: PartiqlAst.Expr.Ne, accumulator: T): T = accumulator
        open protected fun visitExprGt(node: PartiqlAst.Expr.Gt, accumulator: T): T = accumulator
        open protected fun visitExprGte(node: PartiqlAst.Expr.Gte, accumulator: T): T = accumulator
        open protected fun visitExprLt(node: PartiqlAst.Expr.Lt, accumulator: T): T = accumulator
        open protected fun visitExprLte(node: PartiqlAst.Expr.Lte, accumulator: T): T = accumulator
        open protected fun visitExprLike(node: PartiqlAst.Expr.Like, accumulator: T): T = accumulator
        open protected fun visitExprBetween(node: PartiqlAst.Expr.Between, accumulator: T): T = accumulator
        open protected fun visitExprInCollection(node: PartiqlAst.Expr.InCollection, accumulator: T): T = accumulator
        open protected fun visitExprIsType(node: PartiqlAst.Expr.IsType, accumulator: T): T = accumulator
        open protected fun visitExprSimpleCase(node: PartiqlAst.Expr.SimpleCase, accumulator: T): T = accumulator
        open protected fun visitExprSearchedCase(node: PartiqlAst.Expr.SearchedCase, accumulator: T): T = accumulator
        open protected fun visitExprStruct(node: PartiqlAst.Expr.Struct, accumulator: T): T = accumulator
        open protected fun visitExprBag(node: PartiqlAst.Expr.Bag, accumulator: T): T = accumulator
        open protected fun visitExprList(node: PartiqlAst.Expr.List, accumulator: T): T = accumulator
        open protected fun visitExprSexp(node: PartiqlAst.Expr.Sexp, accumulator: T): T = accumulator
        open protected fun visitExprDate(node: PartiqlAst.Expr.Date, accumulator: T): T = accumulator
        open protected fun visitExprLitTime(node: PartiqlAst.Expr.LitTime, accumulator: T): T = accumulator
        open protected fun visitExprBagOp(node: PartiqlAst.Expr.BagOp, accumulator: T): T = accumulator
        open protected fun visitExprGraphMatch(node: PartiqlAst.Expr.GraphMatch, accumulator: T): T = accumulator
        open protected fun visitExprPath(node: PartiqlAst.Expr.Path, accumulator: T): T = accumulator
        open protected fun visitExprCall(node: PartiqlAst.Expr.Call, accumulator: T): T = accumulator
        open protected fun visitExprCallAgg(node: PartiqlAst.Expr.CallAgg, accumulator: T): T = accumulator
        open protected fun visitExprCallWindow(node: PartiqlAst.Expr.CallWindow, accumulator: T): T = accumulator
        open protected fun visitExprCast(node: PartiqlAst.Expr.Cast, accumulator: T): T = accumulator
        open protected fun visitExprCanCast(node: PartiqlAst.Expr.CanCast, accumulator: T): T = accumulator
        open protected fun visitExprCanLosslessCast(node: PartiqlAst.Expr.CanLosslessCast, accumulator: T): T = accumulator
        open protected fun visitExprNullIf(node: PartiqlAst.Expr.NullIf, accumulator: T): T = accumulator
        open protected fun visitExprCoalesce(node: PartiqlAst.Expr.Coalesce, accumulator: T): T = accumulator
        open protected fun visitExprSelect(node: PartiqlAst.Expr.Select, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: PathStep
        //////////////////////////////////////
        open protected fun visitPathStep(node: PartiqlAst.PathStep, accumulator: T): T = accumulator
        open protected fun visitPathStepPathExpr(node: PartiqlAst.PathStep.PathExpr, accumulator: T): T = accumulator
        open protected fun visitPathStepPathWildcard(node: PartiqlAst.PathStep.PathWildcard, accumulator: T): T = accumulator
        open protected fun visitPathStepPathUnpivot(node: PartiqlAst.PathStep.PathUnpivot, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: Projection
        //////////////////////////////////////
        open protected fun visitProjection(node: PartiqlAst.Projection, accumulator: T): T = accumulator
        open protected fun visitProjectionProjectStar(node: PartiqlAst.Projection.ProjectStar, accumulator: T): T = accumulator
        open protected fun visitProjectionProjectList(node: PartiqlAst.Projection.ProjectList, accumulator: T): T = accumulator
        open protected fun visitProjectionProjectPivot(node: PartiqlAst.Projection.ProjectPivot, accumulator: T): T = accumulator
        open protected fun visitProjectionProjectValue(node: PartiqlAst.Projection.ProjectValue, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: ProjectItem
        //////////////////////////////////////
        open protected fun visitProjectItem(node: PartiqlAst.ProjectItem, accumulator: T): T = accumulator
        open protected fun visitProjectItemProjectAll(node: PartiqlAst.ProjectItem.ProjectAll, accumulator: T): T = accumulator
        open protected fun visitProjectItemProjectExpr(node: PartiqlAst.ProjectItem.ProjectExpr, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: FromSource
        //////////////////////////////////////
        open protected fun visitFromSource(node: PartiqlAst.FromSource, accumulator: T): T = accumulator
        open protected fun visitFromSourceScan(node: PartiqlAst.FromSource.Scan, accumulator: T): T = accumulator
        open protected fun visitFromSourceUnpivot(node: PartiqlAst.FromSource.Unpivot, accumulator: T): T = accumulator
        open protected fun visitFromSourceJoin(node: PartiqlAst.FromSource.Join, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: JoinType
        //////////////////////////////////////
        open protected fun visitJoinType(node: PartiqlAst.JoinType, accumulator: T): T = accumulator
        open protected fun visitJoinTypeInner(node: PartiqlAst.JoinType.Inner, accumulator: T): T = accumulator
        open protected fun visitJoinTypeLeft(node: PartiqlAst.JoinType.Left, accumulator: T): T = accumulator
        open protected fun visitJoinTypeRight(node: PartiqlAst.JoinType.Right, accumulator: T): T = accumulator
        open protected fun visitJoinTypeFull(node: PartiqlAst.JoinType.Full, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: GraphMatchDirection
        //////////////////////////////////////
        open protected fun visitGraphMatchDirection(node: PartiqlAst.GraphMatchDirection, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeLeft(node: PartiqlAst.GraphMatchDirection.EdgeLeft, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeUndirected(node: PartiqlAst.GraphMatchDirection.EdgeUndirected, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeRight(node: PartiqlAst.GraphMatchDirection.EdgeRight, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeLeftOrUndirected(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeUndirectedOrRight(node: PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeLeftOrRight(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrRight, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: GraphMatchPatternPart
        //////////////////////////////////////
        open protected fun visitGraphMatchPatternPart(node: PartiqlAst.GraphMatchPatternPart, accumulator: T): T = accumulator
        open protected fun visitGraphMatchPatternPartNode(node: PartiqlAst.GraphMatchPatternPart.Node, accumulator: T): T = accumulator
        open protected fun visitGraphMatchPatternPartEdge(node: PartiqlAst.GraphMatchPatternPart.Edge, accumulator: T): T = accumulator
        open protected fun visitGraphMatchPatternPartPattern(node: PartiqlAst.GraphMatchPatternPart.Pattern, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: GraphMatchRestrictor
        //////////////////////////////////////
        open protected fun visitGraphMatchRestrictor(node: PartiqlAst.GraphMatchRestrictor, accumulator: T): T = accumulator
        open protected fun visitGraphMatchRestrictorRestrictorTrail(node: PartiqlAst.GraphMatchRestrictor.RestrictorTrail, accumulator: T): T = accumulator
        open protected fun visitGraphMatchRestrictorRestrictorAcyclic(node: PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic, accumulator: T): T = accumulator
        open protected fun visitGraphMatchRestrictorRestrictorSimple(node: PartiqlAst.GraphMatchRestrictor.RestrictorSimple, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: GraphMatchSelector
        //////////////////////////////////////
        open protected fun visitGraphMatchSelector(node: PartiqlAst.GraphMatchSelector, accumulator: T): T = accumulator
        open protected fun visitGraphMatchSelectorSelectorAnyShortest(node: PartiqlAst.GraphMatchSelector.SelectorAnyShortest, accumulator: T): T = accumulator
        open protected fun visitGraphMatchSelectorSelectorAllShortest(node: PartiqlAst.GraphMatchSelector.SelectorAllShortest, accumulator: T): T = accumulator
        open protected fun visitGraphMatchSelectorSelectorAny(node: PartiqlAst.GraphMatchSelector.SelectorAny, accumulator: T): T = accumulator
        open protected fun visitGraphMatchSelectorSelectorAnyK(node: PartiqlAst.GraphMatchSelector.SelectorAnyK, accumulator: T): T = accumulator
        open protected fun visitGraphMatchSelectorSelectorShortestK(node: PartiqlAst.GraphMatchSelector.SelectorShortestK, accumulator: T): T = accumulator
        open protected fun visitGraphMatchSelectorSelectorShortestKGroup(node: PartiqlAst.GraphMatchSelector.SelectorShortestKGroup, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: GroupingStrategy
        //////////////////////////////////////
        open protected fun visitGroupingStrategy(node: PartiqlAst.GroupingStrategy, accumulator: T): T = accumulator
        open protected fun visitGroupingStrategyGroupFull(node: PartiqlAst.GroupingStrategy.GroupFull, accumulator: T): T = accumulator
        open protected fun visitGroupingStrategyGroupPartial(node: PartiqlAst.GroupingStrategy.GroupPartial, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: OrderingSpec
        //////////////////////////////////////
        open protected fun visitOrderingSpec(node: PartiqlAst.OrderingSpec, accumulator: T): T = accumulator
        open protected fun visitOrderingSpecAsc(node: PartiqlAst.OrderingSpec.Asc, accumulator: T): T = accumulator
        open protected fun visitOrderingSpecDesc(node: PartiqlAst.OrderingSpec.Desc, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: NullsSpec
        //////////////////////////////////////
        open protected fun visitNullsSpec(node: PartiqlAst.NullsSpec, accumulator: T): T = accumulator
        open protected fun visitNullsSpecNullsFirst(node: PartiqlAst.NullsSpec.NullsFirst, accumulator: T): T = accumulator
        open protected fun visitNullsSpecNullsLast(node: PartiqlAst.NullsSpec.NullsLast, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: CaseSensitivity
        //////////////////////////////////////
        open protected fun visitCaseSensitivity(node: PartiqlAst.CaseSensitivity, accumulator: T): T = accumulator
        open protected fun visitCaseSensitivityCaseSensitive(node: PartiqlAst.CaseSensitivity.CaseSensitive, accumulator: T): T = accumulator
        open protected fun visitCaseSensitivityCaseInsensitive(node: PartiqlAst.CaseSensitivity.CaseInsensitive, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: ScopeQualifier
        //////////////////////////////////////
        open protected fun visitScopeQualifier(node: PartiqlAst.ScopeQualifier, accumulator: T): T = accumulator
        open protected fun visitScopeQualifierUnqualified(node: PartiqlAst.ScopeQualifier.Unqualified, accumulator: T): T = accumulator
        open protected fun visitScopeQualifierLocalsFirst(node: PartiqlAst.ScopeQualifier.LocalsFirst, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: SetQuantifier
        //////////////////////////////////////
        open protected fun visitSetQuantifier(node: PartiqlAst.SetQuantifier, accumulator: T): T = accumulator
        open protected fun visitSetQuantifierAll(node: PartiqlAst.SetQuantifier.All, accumulator: T): T = accumulator
        open protected fun visitSetQuantifierDistinct(node: PartiqlAst.SetQuantifier.Distinct, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: BagOpType
        //////////////////////////////////////
        open protected fun visitBagOpType(node: PartiqlAst.BagOpType, accumulator: T): T = accumulator
        open protected fun visitBagOpTypeUnion(node: PartiqlAst.BagOpType.Union, accumulator: T): T = accumulator
        open protected fun visitBagOpTypeIntersect(node: PartiqlAst.BagOpType.Intersect, accumulator: T): T = accumulator
        open protected fun visitBagOpTypeExcept(node: PartiqlAst.BagOpType.Except, accumulator: T): T = accumulator
        open protected fun visitBagOpTypeOuterUnion(node: PartiqlAst.BagOpType.OuterUnion, accumulator: T): T = accumulator
        open protected fun visitBagOpTypeOuterIntersect(node: PartiqlAst.BagOpType.OuterIntersect, accumulator: T): T = accumulator
        open protected fun visitBagOpTypeOuterExcept(node: PartiqlAst.BagOpType.OuterExcept, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: DmlOp
        //////////////////////////////////////
        open protected fun visitDmlOp(node: PartiqlAst.DmlOp, accumulator: T): T = accumulator
        open protected fun visitDmlOpInsert(node: PartiqlAst.DmlOp.Insert, accumulator: T): T = accumulator
        open protected fun visitDmlOpInsertValue(node: PartiqlAst.DmlOp.InsertValue, accumulator: T): T = accumulator
        open protected fun visitDmlOpSet(node: PartiqlAst.DmlOp.Set, accumulator: T): T = accumulator
        open protected fun visitDmlOpRemove(node: PartiqlAst.DmlOp.Remove, accumulator: T): T = accumulator
        open protected fun visitDmlOpDelete(node: PartiqlAst.DmlOp.Delete, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: ConflictAction
        //////////////////////////////////////
        open protected fun visitConflictAction(node: PartiqlAst.ConflictAction, accumulator: T): T = accumulator
        open protected fun visitConflictActionDoReplace(node: PartiqlAst.ConflictAction.DoReplace, accumulator: T): T = accumulator
        open protected fun visitConflictActionDoUpdate(node: PartiqlAst.ConflictAction.DoUpdate, accumulator: T): T = accumulator
        open protected fun visitConflictActionDoNothing(node: PartiqlAst.ConflictAction.DoNothing, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: OnConflictValue
        //////////////////////////////////////
        open protected fun visitOnConflictValue(node: PartiqlAst.OnConflictValue, accumulator: T): T = accumulator
        open protected fun visitOnConflictValueExcluded(node: PartiqlAst.OnConflictValue.Excluded, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: DdlOp
        //////////////////////////////////////
        open protected fun visitDdlOp(node: PartiqlAst.DdlOp, accumulator: T): T = accumulator
        open protected fun visitDdlOpCreateTable(node: PartiqlAst.DdlOp.CreateTable, accumulator: T): T = accumulator
        open protected fun visitDdlOpDropTable(node: PartiqlAst.DdlOp.DropTable, accumulator: T): T = accumulator
        open protected fun visitDdlOpCreateIndex(node: PartiqlAst.DdlOp.CreateIndex, accumulator: T): T = accumulator
        open protected fun visitDdlOpDropIndex(node: PartiqlAst.DdlOp.DropIndex, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: ColumnComponent
        //////////////////////////////////////
        open protected fun visitColumnComponent(node: PartiqlAst.ColumnComponent, accumulator: T): T = accumulator
        open protected fun visitColumnComponentReturningWildcard(node: PartiqlAst.ColumnComponent.ReturningWildcard, accumulator: T): T = accumulator
        open protected fun visitColumnComponentReturningColumn(node: PartiqlAst.ColumnComponent.ReturningColumn, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: ReturningMapping
        //////////////////////////////////////
        open protected fun visitReturningMapping(node: PartiqlAst.ReturningMapping, accumulator: T): T = accumulator
        open protected fun visitReturningMappingModifiedNew(node: PartiqlAst.ReturningMapping.ModifiedNew, accumulator: T): T = accumulator
        open protected fun visitReturningMappingModifiedOld(node: PartiqlAst.ReturningMapping.ModifiedOld, accumulator: T): T = accumulator
        open protected fun visitReturningMappingAllNew(node: PartiqlAst.ReturningMapping.AllNew, accumulator: T): T = accumulator
        open protected fun visitReturningMappingAllOld(node: PartiqlAst.ReturningMapping.AllOld, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: Type
        //////////////////////////////////////
        open protected fun visitType(node: PartiqlAst.Type, accumulator: T): T = accumulator
        open protected fun visitTypeNullType(node: PartiqlAst.Type.NullType, accumulator: T): T = accumulator
        open protected fun visitTypeBooleanType(node: PartiqlAst.Type.BooleanType, accumulator: T): T = accumulator
        open protected fun visitTypeSmallintType(node: PartiqlAst.Type.SmallintType, accumulator: T): T = accumulator
        open protected fun visitTypeInteger4Type(node: PartiqlAst.Type.Integer4Type, accumulator: T): T = accumulator
        open protected fun visitTypeInteger8Type(node: PartiqlAst.Type.Integer8Type, accumulator: T): T = accumulator
        open protected fun visitTypeIntegerType(node: PartiqlAst.Type.IntegerType, accumulator: T): T = accumulator
        open protected fun visitTypeFloatType(node: PartiqlAst.Type.FloatType, accumulator: T): T = accumulator
        open protected fun visitTypeRealType(node: PartiqlAst.Type.RealType, accumulator: T): T = accumulator
        open protected fun visitTypeDoublePrecisionType(node: PartiqlAst.Type.DoublePrecisionType, accumulator: T): T = accumulator
        open protected fun visitTypeDecimalType(node: PartiqlAst.Type.DecimalType, accumulator: T): T = accumulator
        open protected fun visitTypeNumericType(node: PartiqlAst.Type.NumericType, accumulator: T): T = accumulator
        open protected fun visitTypeTimestampType(node: PartiqlAst.Type.TimestampType, accumulator: T): T = accumulator
        open protected fun visitTypeCharacterType(node: PartiqlAst.Type.CharacterType, accumulator: T): T = accumulator
        open protected fun visitTypeCharacterVaryingType(node: PartiqlAst.Type.CharacterVaryingType, accumulator: T): T = accumulator
        open protected fun visitTypeMissingType(node: PartiqlAst.Type.MissingType, accumulator: T): T = accumulator
        open protected fun visitTypeStringType(node: PartiqlAst.Type.StringType, accumulator: T): T = accumulator
        open protected fun visitTypeSymbolType(node: PartiqlAst.Type.SymbolType, accumulator: T): T = accumulator
        open protected fun visitTypeBlobType(node: PartiqlAst.Type.BlobType, accumulator: T): T = accumulator
        open protected fun visitTypeClobType(node: PartiqlAst.Type.ClobType, accumulator: T): T = accumulator
        open protected fun visitTypeDateType(node: PartiqlAst.Type.DateType, accumulator: T): T = accumulator
        open protected fun visitTypeTimeType(node: PartiqlAst.Type.TimeType, accumulator: T): T = accumulator
        open protected fun visitTypeTimeWithTimeZoneType(node: PartiqlAst.Type.TimeWithTimeZoneType, accumulator: T): T = accumulator
        open protected fun visitTypeStructType(node: PartiqlAst.Type.StructType, accumulator: T): T = accumulator
        open protected fun visitTypeTupleType(node: PartiqlAst.Type.TupleType, accumulator: T): T = accumulator
        open protected fun visitTypeListType(node: PartiqlAst.Type.ListType, accumulator: T): T = accumulator
        open protected fun visitTypeSexpType(node: PartiqlAst.Type.SexpType, accumulator: T): T = accumulator
        open protected fun visitTypeBagType(node: PartiqlAst.Type.BagType, accumulator: T): T = accumulator
        open protected fun visitTypeAnyType(node: PartiqlAst.Type.AnyType, accumulator: T): T = accumulator
        open protected fun visitTypeCustomType(node: PartiqlAst.Type.CustomType, accumulator: T): T = accumulator
    
        ////////////////////////////////////////////////////////////////////////////
        // Walk Functions
        ////////////////////////////////////////////////////////////////////////////
    
        //////////////////////////////////////
        // Tuple Types
        //////////////////////////////////////
        open fun walkTimeValue(node: PartiqlAst.TimeValue, accumulator: T): T {
            var current = accumulator
            current = visitTimeValue(node, current)
            current = walkLongPrimitive(node.hour, current)
            current = walkLongPrimitive(node.minute, current)
            current = walkLongPrimitive(node.second, current)
            current = walkLongPrimitive(node.nano, current)
            current = walkLongPrimitive(node.precision, current)
            current = walkBoolPrimitive(node.withTimeZone, current)
            node.tzMinutes?.let { current = walkLongPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkLet(node: PartiqlAst.Let, accumulator: T): T {
            var current = accumulator
            current = visitLet(node, current)
            node.letBindings.map { current = walkLetBinding(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkLetBinding(node: PartiqlAst.LetBinding, accumulator: T): T {
            var current = accumulator
            current = visitLetBinding(node, current)
            current = walkExpr(node.expr, current)
            current = walkSymbolPrimitive(node.name, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchQuantifier(node: PartiqlAst.GraphMatchQuantifier, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchQuantifier(node, current)
            current = walkLongPrimitive(node.lower, current)
            node.upper?.let { current = walkLongPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchPattern(node: PartiqlAst.GraphMatchPattern, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchPattern(node, current)
            node.restrictor?.let { current = walkGraphMatchRestrictor(it, current) }
            node.prefilter?.let { current = walkExpr(it, current) }
            node.variable?.let { current = walkSymbolPrimitive(it, current) }
            node.quantifier?.let { current = walkGraphMatchQuantifier(it, current) }
            node.parts.map { current = walkGraphMatchPatternPart(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGpmlPattern(node: PartiqlAst.GpmlPattern, accumulator: T): T {
            var current = accumulator
            current = visitGpmlPattern(node, current)
            node.selector?.let { current = walkGraphMatchSelector(it, current) }
            node.patterns.map { current = walkGraphMatchPattern(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprPair(node: PartiqlAst.ExprPair, accumulator: T): T {
            var current = accumulator
            current = visitExprPair(node, current)
            current = walkExpr(node.first, current)
            current = walkExpr(node.second, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprPairList(node: PartiqlAst.ExprPairList, accumulator: T): T {
            var current = accumulator
            current = visitExprPairList(node, current)
            node.pairs.map { current = walkExprPair(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGroupBy(node: PartiqlAst.GroupBy, accumulator: T): T {
            var current = accumulator
            current = visitGroupBy(node, current)
            current = walkGroupingStrategy(node.strategy, current)
            current = walkGroupKeyList(node.keyList, current)
            node.groupAsAlias?.let { current = walkSymbolPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGroupKeyList(node: PartiqlAst.GroupKeyList, accumulator: T): T {
            var current = accumulator
            current = visitGroupKeyList(node, current)
            node.keys.map { current = walkGroupKey(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGroupKey(node: PartiqlAst.GroupKey, accumulator: T): T {
            var current = accumulator
            current = visitGroupKey(node, current)
            current = walkExpr(node.expr, current)
            node.asAlias?.let { current = walkSymbolPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkOrderBy(node: PartiqlAst.OrderBy, accumulator: T): T {
            var current = accumulator
            current = visitOrderBy(node, current)
            node.sortSpecs.map { current = walkSortSpec(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkSortSpec(node: PartiqlAst.SortSpec, accumulator: T): T {
            var current = accumulator
            current = visitSortSpec(node, current)
            current = walkExpr(node.expr, current)
            node.orderingSpec?.let { current = walkOrderingSpec(it, current) }
            node.nullsSpec?.let { current = walkNullsSpec(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkOver(node: PartiqlAst.Over, accumulator: T): T {
            var current = accumulator
            current = visitOver(node, current)
            node.partitionBy?.let { current = walkWindowPartitionList(it, current) }
            node.orderBy?.let { current = walkWindowSortSpecList(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkWindowPartitionList(node: PartiqlAst.WindowPartitionList, accumulator: T): T {
            var current = accumulator
            current = visitWindowPartitionList(node, current)
            node.exprs.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkWindowSortSpecList(node: PartiqlAst.WindowSortSpecList, accumulator: T): T {
            var current = accumulator
            current = visitWindowSortSpecList(node, current)
            node.sortSpecs.map { current = walkSortSpec(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkDmlOpList(node: PartiqlAst.DmlOpList, accumulator: T): T {
            var current = accumulator
            current = visitDmlOpList(node, current)
            node.ops.map { current = walkDmlOp(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkOnConflict(node: PartiqlAst.OnConflict, accumulator: T): T {
            var current = accumulator
            current = visitOnConflict(node, current)
            current = walkExpr(node.expr, current)
            current = walkConflictAction(node.conflictAction, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkReturningExpr(node: PartiqlAst.ReturningExpr, accumulator: T): T {
            var current = accumulator
            current = visitReturningExpr(node, current)
            node.elems.map { current = walkReturningElem(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkReturningElem(node: PartiqlAst.ReturningElem, accumulator: T): T {
            var current = accumulator
            current = visitReturningElem(node, current)
            current = walkReturningMapping(node.mapping, current)
            current = walkColumnComponent(node.column, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkIdentifier(node: PartiqlAst.Identifier, accumulator: T): T {
            var current = accumulator
            current = visitIdentifier(node, current)
            current = walkSymbolPrimitive(node.name, current)
            current = walkCaseSensitivity(node.case, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkAssignment(node: PartiqlAst.Assignment, accumulator: T): T {
            var current = accumulator
            current = visitAssignment(node, current)
            current = walkExpr(node.target, current)
            current = walkExpr(node.value, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: Statement
        //////////////////////////////////////
        open fun walkStatement(node: PartiqlAst.Statement, accumulator: T): T {
            val current = visitStatement(node, accumulator)
            return when(node) {
                is PartiqlAst.Statement.Query -> walkStatementQuery(node, current)
                is PartiqlAst.Statement.Dml -> walkStatementDml(node, current)
                is PartiqlAst.Statement.Ddl -> walkStatementDdl(node, current)
                is PartiqlAst.Statement.Exec -> walkStatementExec(node, current)
                is PartiqlAst.Statement.Explain -> walkStatementExplain(node, current)
            }
        }
    
        open fun walkStatementQuery(node: PartiqlAst.Statement.Query, accumulator: T): T {
            var current = accumulator
            current = visitStatementQuery(node, current)
            current = walkExpr(node.expr, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkStatementDml(node: PartiqlAst.Statement.Dml, accumulator: T): T {
            var current = accumulator
            current = visitStatementDml(node, current)
            current = walkDmlOpList(node.operations, current)
            node.from?.let { current = walkFromSource(it, current) }
            node.where?.let { current = walkExpr(it, current) }
            node.returning?.let { current = walkReturningExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkStatementDdl(node: PartiqlAst.Statement.Ddl, accumulator: T): T {
            var current = accumulator
            current = visitStatementDdl(node, current)
            current = walkDdlOp(node.op, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkStatementExec(node: PartiqlAst.Statement.Exec, accumulator: T): T {
            var current = accumulator
            current = visitStatementExec(node, current)
            current = walkSymbolPrimitive(node.procedureName, current)
            node.args.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkStatementExplain(node: PartiqlAst.Statement.Explain, accumulator: T): T {
            var current = accumulator
            current = visitStatementExplain(node, current)
            current = walkExplainTarget(node.target, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: ExplainTarget
        //////////////////////////////////////
        open fun walkExplainTarget(node: PartiqlAst.ExplainTarget, accumulator: T): T {
            val current = visitExplainTarget(node, accumulator)
            return when(node) {
                is PartiqlAst.ExplainTarget.Domain -> walkExplainTargetDomain(node, current)
            }
        }
    
        open fun walkExplainTargetDomain(node: PartiqlAst.ExplainTarget.Domain, accumulator: T): T {
            var current = accumulator
            current = visitExplainTargetDomain(node, current)
            current = walkStatement(node.statement, current)
            node.type?.let { current = walkSymbolPrimitive(it, current) }
            node.format?.let { current = walkSymbolPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: Expr
        //////////////////////////////////////
        open fun walkExpr(node: PartiqlAst.Expr, accumulator: T): T {
            val current = visitExpr(node, accumulator)
            return when(node) {
                is PartiqlAst.Expr.Missing -> walkExprMissing(node, current)
                is PartiqlAst.Expr.Lit -> walkExprLit(node, current)
                is PartiqlAst.Expr.Id -> walkExprId(node, current)
                is PartiqlAst.Expr.Parameter -> walkExprParameter(node, current)
                is PartiqlAst.Expr.Not -> walkExprNot(node, current)
                is PartiqlAst.Expr.Pos -> walkExprPos(node, current)
                is PartiqlAst.Expr.Neg -> walkExprNeg(node, current)
                is PartiqlAst.Expr.Plus -> walkExprPlus(node, current)
                is PartiqlAst.Expr.Minus -> walkExprMinus(node, current)
                is PartiqlAst.Expr.Times -> walkExprTimes(node, current)
                is PartiqlAst.Expr.Divide -> walkExprDivide(node, current)
                is PartiqlAst.Expr.Modulo -> walkExprModulo(node, current)
                is PartiqlAst.Expr.Concat -> walkExprConcat(node, current)
                is PartiqlAst.Expr.And -> walkExprAnd(node, current)
                is PartiqlAst.Expr.Or -> walkExprOr(node, current)
                is PartiqlAst.Expr.Eq -> walkExprEq(node, current)
                is PartiqlAst.Expr.Ne -> walkExprNe(node, current)
                is PartiqlAst.Expr.Gt -> walkExprGt(node, current)
                is PartiqlAst.Expr.Gte -> walkExprGte(node, current)
                is PartiqlAst.Expr.Lt -> walkExprLt(node, current)
                is PartiqlAst.Expr.Lte -> walkExprLte(node, current)
                is PartiqlAst.Expr.Like -> walkExprLike(node, current)
                is PartiqlAst.Expr.Between -> walkExprBetween(node, current)
                is PartiqlAst.Expr.InCollection -> walkExprInCollection(node, current)
                is PartiqlAst.Expr.IsType -> walkExprIsType(node, current)
                is PartiqlAst.Expr.SimpleCase -> walkExprSimpleCase(node, current)
                is PartiqlAst.Expr.SearchedCase -> walkExprSearchedCase(node, current)
                is PartiqlAst.Expr.Struct -> walkExprStruct(node, current)
                is PartiqlAst.Expr.Bag -> walkExprBag(node, current)
                is PartiqlAst.Expr.List -> walkExprList(node, current)
                is PartiqlAst.Expr.Sexp -> walkExprSexp(node, current)
                is PartiqlAst.Expr.Date -> walkExprDate(node, current)
                is PartiqlAst.Expr.LitTime -> walkExprLitTime(node, current)
                is PartiqlAst.Expr.BagOp -> walkExprBagOp(node, current)
                is PartiqlAst.Expr.GraphMatch -> walkExprGraphMatch(node, current)
                is PartiqlAst.Expr.Path -> walkExprPath(node, current)
                is PartiqlAst.Expr.Call -> walkExprCall(node, current)
                is PartiqlAst.Expr.CallAgg -> walkExprCallAgg(node, current)
                is PartiqlAst.Expr.CallWindow -> walkExprCallWindow(node, current)
                is PartiqlAst.Expr.Cast -> walkExprCast(node, current)
                is PartiqlAst.Expr.CanCast -> walkExprCanCast(node, current)
                is PartiqlAst.Expr.CanLosslessCast -> walkExprCanLosslessCast(node, current)
                is PartiqlAst.Expr.NullIf -> walkExprNullIf(node, current)
                is PartiqlAst.Expr.Coalesce -> walkExprCoalesce(node, current)
                is PartiqlAst.Expr.Select -> walkExprSelect(node, current)
            }
        }
    
        open fun walkExprMissing(node: PartiqlAst.Expr.Missing, accumulator: T): T {
            var current = accumulator
            current = visitExprMissing(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprLit(node: PartiqlAst.Expr.Lit, accumulator: T): T {
            var current = accumulator
            current = visitExprLit(node, current)
            current = walkAnyElement(node.value, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprId(node: PartiqlAst.Expr.Id, accumulator: T): T {
            var current = accumulator
            current = visitExprId(node, current)
            current = walkSymbolPrimitive(node.name, current)
            current = walkCaseSensitivity(node.case, current)
            current = walkScopeQualifier(node.qualifier, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprParameter(node: PartiqlAst.Expr.Parameter, accumulator: T): T {
            var current = accumulator
            current = visitExprParameter(node, current)
            current = walkLongPrimitive(node.index, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprNot(node: PartiqlAst.Expr.Not, accumulator: T): T {
            var current = accumulator
            current = visitExprNot(node, current)
            current = walkExpr(node.expr, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprPos(node: PartiqlAst.Expr.Pos, accumulator: T): T {
            var current = accumulator
            current = visitExprPos(node, current)
            current = walkExpr(node.expr, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprNeg(node: PartiqlAst.Expr.Neg, accumulator: T): T {
            var current = accumulator
            current = visitExprNeg(node, current)
            current = walkExpr(node.expr, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprPlus(node: PartiqlAst.Expr.Plus, accumulator: T): T {
            var current = accumulator
            current = visitExprPlus(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprMinus(node: PartiqlAst.Expr.Minus, accumulator: T): T {
            var current = accumulator
            current = visitExprMinus(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprTimes(node: PartiqlAst.Expr.Times, accumulator: T): T {
            var current = accumulator
            current = visitExprTimes(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprDivide(node: PartiqlAst.Expr.Divide, accumulator: T): T {
            var current = accumulator
            current = visitExprDivide(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprModulo(node: PartiqlAst.Expr.Modulo, accumulator: T): T {
            var current = accumulator
            current = visitExprModulo(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprConcat(node: PartiqlAst.Expr.Concat, accumulator: T): T {
            var current = accumulator
            current = visitExprConcat(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprAnd(node: PartiqlAst.Expr.And, accumulator: T): T {
            var current = accumulator
            current = visitExprAnd(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprOr(node: PartiqlAst.Expr.Or, accumulator: T): T {
            var current = accumulator
            current = visitExprOr(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprEq(node: PartiqlAst.Expr.Eq, accumulator: T): T {
            var current = accumulator
            current = visitExprEq(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprNe(node: PartiqlAst.Expr.Ne, accumulator: T): T {
            var current = accumulator
            current = visitExprNe(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprGt(node: PartiqlAst.Expr.Gt, accumulator: T): T {
            var current = accumulator
            current = visitExprGt(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprGte(node: PartiqlAst.Expr.Gte, accumulator: T): T {
            var current = accumulator
            current = visitExprGte(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprLt(node: PartiqlAst.Expr.Lt, accumulator: T): T {
            var current = accumulator
            current = visitExprLt(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprLte(node: PartiqlAst.Expr.Lte, accumulator: T): T {
            var current = accumulator
            current = visitExprLte(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprLike(node: PartiqlAst.Expr.Like, accumulator: T): T {
            var current = accumulator
            current = visitExprLike(node, current)
            current = walkExpr(node.value, current)
            current = walkExpr(node.pattern, current)
            node.escape?.let { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprBetween(node: PartiqlAst.Expr.Between, accumulator: T): T {
            var current = accumulator
            current = visitExprBetween(node, current)
            current = walkExpr(node.value, current)
            current = walkExpr(node.from, current)
            current = walkExpr(node.to, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprInCollection(node: PartiqlAst.Expr.InCollection, accumulator: T): T {
            var current = accumulator
            current = visitExprInCollection(node, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprIsType(node: PartiqlAst.Expr.IsType, accumulator: T): T {
            var current = accumulator
            current = visitExprIsType(node, current)
            current = walkExpr(node.value, current)
            current = walkType(node.type, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprSimpleCase(node: PartiqlAst.Expr.SimpleCase, accumulator: T): T {
            var current = accumulator
            current = visitExprSimpleCase(node, current)
            current = walkExpr(node.expr, current)
            current = walkExprPairList(node.cases, current)
            node.default?.let { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprSearchedCase(node: PartiqlAst.Expr.SearchedCase, accumulator: T): T {
            var current = accumulator
            current = visitExprSearchedCase(node, current)
            current = walkExprPairList(node.cases, current)
            node.default?.let { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprStruct(node: PartiqlAst.Expr.Struct, accumulator: T): T {
            var current = accumulator
            current = visitExprStruct(node, current)
            node.fields.map { current = walkExprPair(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprBag(node: PartiqlAst.Expr.Bag, accumulator: T): T {
            var current = accumulator
            current = visitExprBag(node, current)
            node.values.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprList(node: PartiqlAst.Expr.List, accumulator: T): T {
            var current = accumulator
            current = visitExprList(node, current)
            node.values.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprSexp(node: PartiqlAst.Expr.Sexp, accumulator: T): T {
            var current = accumulator
            current = visitExprSexp(node, current)
            node.values.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprDate(node: PartiqlAst.Expr.Date, accumulator: T): T {
            var current = accumulator
            current = visitExprDate(node, current)
            current = walkLongPrimitive(node.year, current)
            current = walkLongPrimitive(node.month, current)
            current = walkLongPrimitive(node.day, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprLitTime(node: PartiqlAst.Expr.LitTime, accumulator: T): T {
            var current = accumulator
            current = visitExprLitTime(node, current)
            current = walkTimeValue(node.value, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprBagOp(node: PartiqlAst.Expr.BagOp, accumulator: T): T {
            var current = accumulator
            current = visitExprBagOp(node, current)
            current = walkBagOpType(node.op, current)
            current = walkSetQuantifier(node.quantifier, current)
            node.operands.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprGraphMatch(node: PartiqlAst.Expr.GraphMatch, accumulator: T): T {
            var current = accumulator
            current = visitExprGraphMatch(node, current)
            current = walkExpr(node.expr, current)
            current = walkGpmlPattern(node.gpmlPattern, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprPath(node: PartiqlAst.Expr.Path, accumulator: T): T {
            var current = accumulator
            current = visitExprPath(node, current)
            current = walkExpr(node.root, current)
            node.steps.map { current = walkPathStep(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprCall(node: PartiqlAst.Expr.Call, accumulator: T): T {
            var current = accumulator
            current = visitExprCall(node, current)
            current = walkSymbolPrimitive(node.funcName, current)
            node.args.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprCallAgg(node: PartiqlAst.Expr.CallAgg, accumulator: T): T {
            var current = accumulator
            current = visitExprCallAgg(node, current)
            current = walkSetQuantifier(node.setq, current)
            current = walkSymbolPrimitive(node.funcName, current)
            current = walkExpr(node.arg, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprCallWindow(node: PartiqlAst.Expr.CallWindow, accumulator: T): T {
            var current = accumulator
            current = visitExprCallWindow(node, current)
            current = walkSymbolPrimitive(node.funcName, current)
            current = walkOver(node.over, current)
            node.args.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprCast(node: PartiqlAst.Expr.Cast, accumulator: T): T {
            var current = accumulator
            current = visitExprCast(node, current)
            current = walkExpr(node.value, current)
            current = walkType(node.asType, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprCanCast(node: PartiqlAst.Expr.CanCast, accumulator: T): T {
            var current = accumulator
            current = visitExprCanCast(node, current)
            current = walkExpr(node.value, current)
            current = walkType(node.asType, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprCanLosslessCast(node: PartiqlAst.Expr.CanLosslessCast, accumulator: T): T {
            var current = accumulator
            current = visitExprCanLosslessCast(node, current)
            current = walkExpr(node.value, current)
            current = walkType(node.asType, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprNullIf(node: PartiqlAst.Expr.NullIf, accumulator: T): T {
            var current = accumulator
            current = visitExprNullIf(node, current)
            current = walkExpr(node.expr1, current)
            current = walkExpr(node.expr2, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprCoalesce(node: PartiqlAst.Expr.Coalesce, accumulator: T): T {
            var current = accumulator
            current = visitExprCoalesce(node, current)
            node.args.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprSelect(node: PartiqlAst.Expr.Select, accumulator: T): T {
            var current = accumulator
            current = visitExprSelect(node, current)
            node.setq?.let { current = walkSetQuantifier(it, current) }
            current = walkProjection(node.project, current)
            current = walkFromSource(node.from, current)
            node.fromLet?.let { current = walkLet(it, current) }
            node.where?.let { current = walkExpr(it, current) }
            node.group?.let { current = walkGroupBy(it, current) }
            node.having?.let { current = walkExpr(it, current) }
            node.order?.let { current = walkOrderBy(it, current) }
            node.limit?.let { current = walkExpr(it, current) }
            node.offset?.let { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: PathStep
        //////////////////////////////////////
        open fun walkPathStep(node: PartiqlAst.PathStep, accumulator: T): T {
            val current = visitPathStep(node, accumulator)
            return when(node) {
                is PartiqlAst.PathStep.PathExpr -> walkPathStepPathExpr(node, current)
                is PartiqlAst.PathStep.PathWildcard -> walkPathStepPathWildcard(node, current)
                is PartiqlAst.PathStep.PathUnpivot -> walkPathStepPathUnpivot(node, current)
            }
        }
    
        open fun walkPathStepPathExpr(node: PartiqlAst.PathStep.PathExpr, accumulator: T): T {
            var current = accumulator
            current = visitPathStepPathExpr(node, current)
            current = walkExpr(node.index, current)
            current = walkCaseSensitivity(node.case, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkPathStepPathWildcard(node: PartiqlAst.PathStep.PathWildcard, accumulator: T): T {
            var current = accumulator
            current = visitPathStepPathWildcard(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkPathStepPathUnpivot(node: PartiqlAst.PathStep.PathUnpivot, accumulator: T): T {
            var current = accumulator
            current = visitPathStepPathUnpivot(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: Projection
        //////////////////////////////////////
        open fun walkProjection(node: PartiqlAst.Projection, accumulator: T): T {
            val current = visitProjection(node, accumulator)
            return when(node) {
                is PartiqlAst.Projection.ProjectStar -> walkProjectionProjectStar(node, current)
                is PartiqlAst.Projection.ProjectList -> walkProjectionProjectList(node, current)
                is PartiqlAst.Projection.ProjectPivot -> walkProjectionProjectPivot(node, current)
                is PartiqlAst.Projection.ProjectValue -> walkProjectionProjectValue(node, current)
            }
        }
    
        open fun walkProjectionProjectStar(node: PartiqlAst.Projection.ProjectStar, accumulator: T): T {
            var current = accumulator
            current = visitProjectionProjectStar(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkProjectionProjectList(node: PartiqlAst.Projection.ProjectList, accumulator: T): T {
            var current = accumulator
            current = visitProjectionProjectList(node, current)
            node.projectItems.map { current = walkProjectItem(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkProjectionProjectPivot(node: PartiqlAst.Projection.ProjectPivot, accumulator: T): T {
            var current = accumulator
            current = visitProjectionProjectPivot(node, current)
            current = walkExpr(node.value, current)
            current = walkExpr(node.key, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkProjectionProjectValue(node: PartiqlAst.Projection.ProjectValue, accumulator: T): T {
            var current = accumulator
            current = visitProjectionProjectValue(node, current)
            current = walkExpr(node.value, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: ProjectItem
        //////////////////////////////////////
        open fun walkProjectItem(node: PartiqlAst.ProjectItem, accumulator: T): T {
            val current = visitProjectItem(node, accumulator)
            return when(node) {
                is PartiqlAst.ProjectItem.ProjectAll -> walkProjectItemProjectAll(node, current)
                is PartiqlAst.ProjectItem.ProjectExpr -> walkProjectItemProjectExpr(node, current)
            }
        }
    
        open fun walkProjectItemProjectAll(node: PartiqlAst.ProjectItem.ProjectAll, accumulator: T): T {
            var current = accumulator
            current = visitProjectItemProjectAll(node, current)
            current = walkExpr(node.expr, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkProjectItemProjectExpr(node: PartiqlAst.ProjectItem.ProjectExpr, accumulator: T): T {
            var current = accumulator
            current = visitProjectItemProjectExpr(node, current)
            current = walkExpr(node.expr, current)
            node.asAlias?.let { current = walkSymbolPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: FromSource
        //////////////////////////////////////
        open fun walkFromSource(node: PartiqlAst.FromSource, accumulator: T): T {
            val current = visitFromSource(node, accumulator)
            return when(node) {
                is PartiqlAst.FromSource.Scan -> walkFromSourceScan(node, current)
                is PartiqlAst.FromSource.Unpivot -> walkFromSourceUnpivot(node, current)
                is PartiqlAst.FromSource.Join -> walkFromSourceJoin(node, current)
            }
        }
    
        open fun walkFromSourceScan(node: PartiqlAst.FromSource.Scan, accumulator: T): T {
            var current = accumulator
            current = visitFromSourceScan(node, current)
            current = walkExpr(node.expr, current)
            node.asAlias?.let { current = walkSymbolPrimitive(it, current) }
            node.atAlias?.let { current = walkSymbolPrimitive(it, current) }
            node.byAlias?.let { current = walkSymbolPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkFromSourceUnpivot(node: PartiqlAst.FromSource.Unpivot, accumulator: T): T {
            var current = accumulator
            current = visitFromSourceUnpivot(node, current)
            current = walkExpr(node.expr, current)
            node.asAlias?.let { current = walkSymbolPrimitive(it, current) }
            node.atAlias?.let { current = walkSymbolPrimitive(it, current) }
            node.byAlias?.let { current = walkSymbolPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkFromSourceJoin(node: PartiqlAst.FromSource.Join, accumulator: T): T {
            var current = accumulator
            current = visitFromSourceJoin(node, current)
            current = walkJoinType(node.type, current)
            current = walkFromSource(node.left, current)
            current = walkFromSource(node.right, current)
            node.predicate?.let { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: JoinType
        //////////////////////////////////////
        open fun walkJoinType(node: PartiqlAst.JoinType, accumulator: T): T {
            val current = visitJoinType(node, accumulator)
            return when(node) {
                is PartiqlAst.JoinType.Inner -> walkJoinTypeInner(node, current)
                is PartiqlAst.JoinType.Left -> walkJoinTypeLeft(node, current)
                is PartiqlAst.JoinType.Right -> walkJoinTypeRight(node, current)
                is PartiqlAst.JoinType.Full -> walkJoinTypeFull(node, current)
            }
        }
    
        open fun walkJoinTypeInner(node: PartiqlAst.JoinType.Inner, accumulator: T): T {
            var current = accumulator
            current = visitJoinTypeInner(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkJoinTypeLeft(node: PartiqlAst.JoinType.Left, accumulator: T): T {
            var current = accumulator
            current = visitJoinTypeLeft(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkJoinTypeRight(node: PartiqlAst.JoinType.Right, accumulator: T): T {
            var current = accumulator
            current = visitJoinTypeRight(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkJoinTypeFull(node: PartiqlAst.JoinType.Full, accumulator: T): T {
            var current = accumulator
            current = visitJoinTypeFull(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: GraphMatchDirection
        //////////////////////////////////////
        open fun walkGraphMatchDirection(node: PartiqlAst.GraphMatchDirection, accumulator: T): T {
            val current = visitGraphMatchDirection(node, accumulator)
            return when(node) {
                is PartiqlAst.GraphMatchDirection.EdgeLeft -> walkGraphMatchDirectionEdgeLeft(node, current)
                is PartiqlAst.GraphMatchDirection.EdgeUndirected -> walkGraphMatchDirectionEdgeUndirected(node, current)
                is PartiqlAst.GraphMatchDirection.EdgeRight -> walkGraphMatchDirectionEdgeRight(node, current)
                is PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected -> walkGraphMatchDirectionEdgeLeftOrUndirected(node, current)
                is PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight -> walkGraphMatchDirectionEdgeUndirectedOrRight(node, current)
                is PartiqlAst.GraphMatchDirection.EdgeLeftOrRight -> walkGraphMatchDirectionEdgeLeftOrRight(node, current)
                is PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight -> walkGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node, current)
            }
        }
    
        open fun walkGraphMatchDirectionEdgeLeft(node: PartiqlAst.GraphMatchDirection.EdgeLeft, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchDirectionEdgeLeft(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchDirectionEdgeUndirected(node: PartiqlAst.GraphMatchDirection.EdgeUndirected, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchDirectionEdgeUndirected(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchDirectionEdgeRight(node: PartiqlAst.GraphMatchDirection.EdgeRight, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchDirectionEdgeRight(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchDirectionEdgeLeftOrUndirected(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchDirectionEdgeLeftOrUndirected(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchDirectionEdgeUndirectedOrRight(node: PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchDirectionEdgeUndirectedOrRight(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchDirectionEdgeLeftOrRight(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrRight, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchDirectionEdgeLeftOrRight(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: GraphMatchPatternPart
        //////////////////////////////////////
        open fun walkGraphMatchPatternPart(node: PartiqlAst.GraphMatchPatternPart, accumulator: T): T {
            val current = visitGraphMatchPatternPart(node, accumulator)
            return when(node) {
                is PartiqlAst.GraphMatchPatternPart.Node -> walkGraphMatchPatternPartNode(node, current)
                is PartiqlAst.GraphMatchPatternPart.Edge -> walkGraphMatchPatternPartEdge(node, current)
                is PartiqlAst.GraphMatchPatternPart.Pattern -> walkGraphMatchPatternPartPattern(node, current)
            }
        }
    
        open fun walkGraphMatchPatternPartNode(node: PartiqlAst.GraphMatchPatternPart.Node, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchPatternPartNode(node, current)
            node.prefilter?.let { current = walkExpr(it, current) }
            node.variable?.let { current = walkSymbolPrimitive(it, current) }
            node.label.map { current = walkSymbolPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchPatternPartEdge(node: PartiqlAst.GraphMatchPatternPart.Edge, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchPatternPartEdge(node, current)
            current = walkGraphMatchDirection(node.direction, current)
            node.quantifier?.let { current = walkGraphMatchQuantifier(it, current) }
            node.prefilter?.let { current = walkExpr(it, current) }
            node.variable?.let { current = walkSymbolPrimitive(it, current) }
            node.label.map { current = walkSymbolPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchPatternPartPattern(node: PartiqlAst.GraphMatchPatternPart.Pattern, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchPatternPartPattern(node, current)
            current = walkGraphMatchPattern(node.pattern, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: GraphMatchRestrictor
        //////////////////////////////////////
        open fun walkGraphMatchRestrictor(node: PartiqlAst.GraphMatchRestrictor, accumulator: T): T {
            val current = visitGraphMatchRestrictor(node, accumulator)
            return when(node) {
                is PartiqlAst.GraphMatchRestrictor.RestrictorTrail -> walkGraphMatchRestrictorRestrictorTrail(node, current)
                is PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic -> walkGraphMatchRestrictorRestrictorAcyclic(node, current)
                is PartiqlAst.GraphMatchRestrictor.RestrictorSimple -> walkGraphMatchRestrictorRestrictorSimple(node, current)
            }
        }
    
        open fun walkGraphMatchRestrictorRestrictorTrail(node: PartiqlAst.GraphMatchRestrictor.RestrictorTrail, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchRestrictorRestrictorTrail(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchRestrictorRestrictorAcyclic(node: PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchRestrictorRestrictorAcyclic(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchRestrictorRestrictorSimple(node: PartiqlAst.GraphMatchRestrictor.RestrictorSimple, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchRestrictorRestrictorSimple(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: GraphMatchSelector
        //////////////////////////////////////
        open fun walkGraphMatchSelector(node: PartiqlAst.GraphMatchSelector, accumulator: T): T {
            val current = visitGraphMatchSelector(node, accumulator)
            return when(node) {
                is PartiqlAst.GraphMatchSelector.SelectorAnyShortest -> walkGraphMatchSelectorSelectorAnyShortest(node, current)
                is PartiqlAst.GraphMatchSelector.SelectorAllShortest -> walkGraphMatchSelectorSelectorAllShortest(node, current)
                is PartiqlAst.GraphMatchSelector.SelectorAny -> walkGraphMatchSelectorSelectorAny(node, current)
                is PartiqlAst.GraphMatchSelector.SelectorAnyK -> walkGraphMatchSelectorSelectorAnyK(node, current)
                is PartiqlAst.GraphMatchSelector.SelectorShortestK -> walkGraphMatchSelectorSelectorShortestK(node, current)
                is PartiqlAst.GraphMatchSelector.SelectorShortestKGroup -> walkGraphMatchSelectorSelectorShortestKGroup(node, current)
            }
        }
    
        open fun walkGraphMatchSelectorSelectorAnyShortest(node: PartiqlAst.GraphMatchSelector.SelectorAnyShortest, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchSelectorSelectorAnyShortest(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchSelectorSelectorAllShortest(node: PartiqlAst.GraphMatchSelector.SelectorAllShortest, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchSelectorSelectorAllShortest(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchSelectorSelectorAny(node: PartiqlAst.GraphMatchSelector.SelectorAny, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchSelectorSelectorAny(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchSelectorSelectorAnyK(node: PartiqlAst.GraphMatchSelector.SelectorAnyK, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchSelectorSelectorAnyK(node, current)
            current = walkLongPrimitive(node.k, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchSelectorSelectorShortestK(node: PartiqlAst.GraphMatchSelector.SelectorShortestK, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchSelectorSelectorShortestK(node, current)
            current = walkLongPrimitive(node.k, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchSelectorSelectorShortestKGroup(node: PartiqlAst.GraphMatchSelector.SelectorShortestKGroup, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchSelectorSelectorShortestKGroup(node, current)
            current = walkLongPrimitive(node.k, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: GroupingStrategy
        //////////////////////////////////////
        open fun walkGroupingStrategy(node: PartiqlAst.GroupingStrategy, accumulator: T): T {
            val current = visitGroupingStrategy(node, accumulator)
            return when(node) {
                is PartiqlAst.GroupingStrategy.GroupFull -> walkGroupingStrategyGroupFull(node, current)
                is PartiqlAst.GroupingStrategy.GroupPartial -> walkGroupingStrategyGroupPartial(node, current)
            }
        }
    
        open fun walkGroupingStrategyGroupFull(node: PartiqlAst.GroupingStrategy.GroupFull, accumulator: T): T {
            var current = accumulator
            current = visitGroupingStrategyGroupFull(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGroupingStrategyGroupPartial(node: PartiqlAst.GroupingStrategy.GroupPartial, accumulator: T): T {
            var current = accumulator
            current = visitGroupingStrategyGroupPartial(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: OrderingSpec
        //////////////////////////////////////
        open fun walkOrderingSpec(node: PartiqlAst.OrderingSpec, accumulator: T): T {
            val current = visitOrderingSpec(node, accumulator)
            return when(node) {
                is PartiqlAst.OrderingSpec.Asc -> walkOrderingSpecAsc(node, current)
                is PartiqlAst.OrderingSpec.Desc -> walkOrderingSpecDesc(node, current)
            }
        }
    
        open fun walkOrderingSpecAsc(node: PartiqlAst.OrderingSpec.Asc, accumulator: T): T {
            var current = accumulator
            current = visitOrderingSpecAsc(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkOrderingSpecDesc(node: PartiqlAst.OrderingSpec.Desc, accumulator: T): T {
            var current = accumulator
            current = visitOrderingSpecDesc(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: NullsSpec
        //////////////////////////////////////
        open fun walkNullsSpec(node: PartiqlAst.NullsSpec, accumulator: T): T {
            val current = visitNullsSpec(node, accumulator)
            return when(node) {
                is PartiqlAst.NullsSpec.NullsFirst -> walkNullsSpecNullsFirst(node, current)
                is PartiqlAst.NullsSpec.NullsLast -> walkNullsSpecNullsLast(node, current)
            }
        }
    
        open fun walkNullsSpecNullsFirst(node: PartiqlAst.NullsSpec.NullsFirst, accumulator: T): T {
            var current = accumulator
            current = visitNullsSpecNullsFirst(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkNullsSpecNullsLast(node: PartiqlAst.NullsSpec.NullsLast, accumulator: T): T {
            var current = accumulator
            current = visitNullsSpecNullsLast(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: CaseSensitivity
        //////////////////////////////////////
        open fun walkCaseSensitivity(node: PartiqlAst.CaseSensitivity, accumulator: T): T {
            val current = visitCaseSensitivity(node, accumulator)
            return when(node) {
                is PartiqlAst.CaseSensitivity.CaseSensitive -> walkCaseSensitivityCaseSensitive(node, current)
                is PartiqlAst.CaseSensitivity.CaseInsensitive -> walkCaseSensitivityCaseInsensitive(node, current)
            }
        }
    
        open fun walkCaseSensitivityCaseSensitive(node: PartiqlAst.CaseSensitivity.CaseSensitive, accumulator: T): T {
            var current = accumulator
            current = visitCaseSensitivityCaseSensitive(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkCaseSensitivityCaseInsensitive(node: PartiqlAst.CaseSensitivity.CaseInsensitive, accumulator: T): T {
            var current = accumulator
            current = visitCaseSensitivityCaseInsensitive(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: ScopeQualifier
        //////////////////////////////////////
        open fun walkScopeQualifier(node: PartiqlAst.ScopeQualifier, accumulator: T): T {
            val current = visitScopeQualifier(node, accumulator)
            return when(node) {
                is PartiqlAst.ScopeQualifier.Unqualified -> walkScopeQualifierUnqualified(node, current)
                is PartiqlAst.ScopeQualifier.LocalsFirst -> walkScopeQualifierLocalsFirst(node, current)
            }
        }
    
        open fun walkScopeQualifierUnqualified(node: PartiqlAst.ScopeQualifier.Unqualified, accumulator: T): T {
            var current = accumulator
            current = visitScopeQualifierUnqualified(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkScopeQualifierLocalsFirst(node: PartiqlAst.ScopeQualifier.LocalsFirst, accumulator: T): T {
            var current = accumulator
            current = visitScopeQualifierLocalsFirst(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: SetQuantifier
        //////////////////////////////////////
        open fun walkSetQuantifier(node: PartiqlAst.SetQuantifier, accumulator: T): T {
            val current = visitSetQuantifier(node, accumulator)
            return when(node) {
                is PartiqlAst.SetQuantifier.All -> walkSetQuantifierAll(node, current)
                is PartiqlAst.SetQuantifier.Distinct -> walkSetQuantifierDistinct(node, current)
            }
        }
    
        open fun walkSetQuantifierAll(node: PartiqlAst.SetQuantifier.All, accumulator: T): T {
            var current = accumulator
            current = visitSetQuantifierAll(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkSetQuantifierDistinct(node: PartiqlAst.SetQuantifier.Distinct, accumulator: T): T {
            var current = accumulator
            current = visitSetQuantifierDistinct(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: BagOpType
        //////////////////////////////////////
        open fun walkBagOpType(node: PartiqlAst.BagOpType, accumulator: T): T {
            val current = visitBagOpType(node, accumulator)
            return when(node) {
                is PartiqlAst.BagOpType.Union -> walkBagOpTypeUnion(node, current)
                is PartiqlAst.BagOpType.Intersect -> walkBagOpTypeIntersect(node, current)
                is PartiqlAst.BagOpType.Except -> walkBagOpTypeExcept(node, current)
                is PartiqlAst.BagOpType.OuterUnion -> walkBagOpTypeOuterUnion(node, current)
                is PartiqlAst.BagOpType.OuterIntersect -> walkBagOpTypeOuterIntersect(node, current)
                is PartiqlAst.BagOpType.OuterExcept -> walkBagOpTypeOuterExcept(node, current)
            }
        }
    
        open fun walkBagOpTypeUnion(node: PartiqlAst.BagOpType.Union, accumulator: T): T {
            var current = accumulator
            current = visitBagOpTypeUnion(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBagOpTypeIntersect(node: PartiqlAst.BagOpType.Intersect, accumulator: T): T {
            var current = accumulator
            current = visitBagOpTypeIntersect(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBagOpTypeExcept(node: PartiqlAst.BagOpType.Except, accumulator: T): T {
            var current = accumulator
            current = visitBagOpTypeExcept(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBagOpTypeOuterUnion(node: PartiqlAst.BagOpType.OuterUnion, accumulator: T): T {
            var current = accumulator
            current = visitBagOpTypeOuterUnion(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBagOpTypeOuterIntersect(node: PartiqlAst.BagOpType.OuterIntersect, accumulator: T): T {
            var current = accumulator
            current = visitBagOpTypeOuterIntersect(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBagOpTypeOuterExcept(node: PartiqlAst.BagOpType.OuterExcept, accumulator: T): T {
            var current = accumulator
            current = visitBagOpTypeOuterExcept(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: DmlOp
        //////////////////////////////////////
        open fun walkDmlOp(node: PartiqlAst.DmlOp, accumulator: T): T {
            val current = visitDmlOp(node, accumulator)
            return when(node) {
                is PartiqlAst.DmlOp.Insert -> walkDmlOpInsert(node, current)
                is PartiqlAst.DmlOp.InsertValue -> walkDmlOpInsertValue(node, current)
                is PartiqlAst.DmlOp.Set -> walkDmlOpSet(node, current)
                is PartiqlAst.DmlOp.Remove -> walkDmlOpRemove(node, current)
                is PartiqlAst.DmlOp.Delete -> walkDmlOpDelete(node, current)
            }
        }
    
        open fun walkDmlOpInsert(node: PartiqlAst.DmlOp.Insert, accumulator: T): T {
            var current = accumulator
            current = visitDmlOpInsert(node, current)
            current = walkExpr(node.target, current)
            current = walkExpr(node.values, current)
            node.conflictAction?.let { current = walkConflictAction(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkDmlOpInsertValue(node: PartiqlAst.DmlOp.InsertValue, accumulator: T): T {
            var current = accumulator
            current = visitDmlOpInsertValue(node, current)
            current = walkExpr(node.target, current)
            current = walkExpr(node.value, current)
            node.index?.let { current = walkExpr(it, current) }
            node.onConflict?.let { current = walkOnConflict(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkDmlOpSet(node: PartiqlAst.DmlOp.Set, accumulator: T): T {
            var current = accumulator
            current = visitDmlOpSet(node, current)
            current = walkAssignment(node.assignment, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkDmlOpRemove(node: PartiqlAst.DmlOp.Remove, accumulator: T): T {
            var current = accumulator
            current = visitDmlOpRemove(node, current)
            current = walkExpr(node.target, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkDmlOpDelete(node: PartiqlAst.DmlOp.Delete, accumulator: T): T {
            var current = accumulator
            current = visitDmlOpDelete(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: ConflictAction
        //////////////////////////////////////
        open fun walkConflictAction(node: PartiqlAst.ConflictAction, accumulator: T): T {
            val current = visitConflictAction(node, accumulator)
            return when(node) {
                is PartiqlAst.ConflictAction.DoReplace -> walkConflictActionDoReplace(node, current)
                is PartiqlAst.ConflictAction.DoUpdate -> walkConflictActionDoUpdate(node, current)
                is PartiqlAst.ConflictAction.DoNothing -> walkConflictActionDoNothing(node, current)
            }
        }
    
        open fun walkConflictActionDoReplace(node: PartiqlAst.ConflictAction.DoReplace, accumulator: T): T {
            var current = accumulator
            current = visitConflictActionDoReplace(node, current)
            current = walkOnConflictValue(node.value, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkConflictActionDoUpdate(node: PartiqlAst.ConflictAction.DoUpdate, accumulator: T): T {
            var current = accumulator
            current = visitConflictActionDoUpdate(node, current)
            current = walkOnConflictValue(node.value, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkConflictActionDoNothing(node: PartiqlAst.ConflictAction.DoNothing, accumulator: T): T {
            var current = accumulator
            current = visitConflictActionDoNothing(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: OnConflictValue
        //////////////////////////////////////
        open fun walkOnConflictValue(node: PartiqlAst.OnConflictValue, accumulator: T): T {
            val current = visitOnConflictValue(node, accumulator)
            return when(node) {
                is PartiqlAst.OnConflictValue.Excluded -> walkOnConflictValueExcluded(node, current)
            }
        }
    
        open fun walkOnConflictValueExcluded(node: PartiqlAst.OnConflictValue.Excluded, accumulator: T): T {
            var current = accumulator
            current = visitOnConflictValueExcluded(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: DdlOp
        //////////////////////////////////////
        open fun walkDdlOp(node: PartiqlAst.DdlOp, accumulator: T): T {
            val current = visitDdlOp(node, accumulator)
            return when(node) {
                is PartiqlAst.DdlOp.CreateTable -> walkDdlOpCreateTable(node, current)
                is PartiqlAst.DdlOp.DropTable -> walkDdlOpDropTable(node, current)
                is PartiqlAst.DdlOp.CreateIndex -> walkDdlOpCreateIndex(node, current)
                is PartiqlAst.DdlOp.DropIndex -> walkDdlOpDropIndex(node, current)
            }
        }
    
        open fun walkDdlOpCreateTable(node: PartiqlAst.DdlOp.CreateTable, accumulator: T): T {
            var current = accumulator
            current = visitDdlOpCreateTable(node, current)
            current = walkSymbolPrimitive(node.tableName, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkDdlOpDropTable(node: PartiqlAst.DdlOp.DropTable, accumulator: T): T {
            var current = accumulator
            current = visitDdlOpDropTable(node, current)
            current = walkIdentifier(node.tableName, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkDdlOpCreateIndex(node: PartiqlAst.DdlOp.CreateIndex, accumulator: T): T {
            var current = accumulator
            current = visitDdlOpCreateIndex(node, current)
            current = walkIdentifier(node.indexName, current)
            node.fields.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkDdlOpDropIndex(node: PartiqlAst.DdlOp.DropIndex, accumulator: T): T {
            var current = accumulator
            current = visitDdlOpDropIndex(node, current)
            current = walkIdentifier(node.table, current)
            current = walkIdentifier(node.keys, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: ColumnComponent
        //////////////////////////////////////
        open fun walkColumnComponent(node: PartiqlAst.ColumnComponent, accumulator: T): T {
            val current = visitColumnComponent(node, accumulator)
            return when(node) {
                is PartiqlAst.ColumnComponent.ReturningWildcard -> walkColumnComponentReturningWildcard(node, current)
                is PartiqlAst.ColumnComponent.ReturningColumn -> walkColumnComponentReturningColumn(node, current)
            }
        }
    
        open fun walkColumnComponentReturningWildcard(node: PartiqlAst.ColumnComponent.ReturningWildcard, accumulator: T): T {
            var current = accumulator
            current = visitColumnComponentReturningWildcard(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkColumnComponentReturningColumn(node: PartiqlAst.ColumnComponent.ReturningColumn, accumulator: T): T {
            var current = accumulator
            current = visitColumnComponentReturningColumn(node, current)
            current = walkExpr(node.expr, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: ReturningMapping
        //////////////////////////////////////
        open fun walkReturningMapping(node: PartiqlAst.ReturningMapping, accumulator: T): T {
            val current = visitReturningMapping(node, accumulator)
            return when(node) {
                is PartiqlAst.ReturningMapping.ModifiedNew -> walkReturningMappingModifiedNew(node, current)
                is PartiqlAst.ReturningMapping.ModifiedOld -> walkReturningMappingModifiedOld(node, current)
                is PartiqlAst.ReturningMapping.AllNew -> walkReturningMappingAllNew(node, current)
                is PartiqlAst.ReturningMapping.AllOld -> walkReturningMappingAllOld(node, current)
            }
        }
    
        open fun walkReturningMappingModifiedNew(node: PartiqlAst.ReturningMapping.ModifiedNew, accumulator: T): T {
            var current = accumulator
            current = visitReturningMappingModifiedNew(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkReturningMappingModifiedOld(node: PartiqlAst.ReturningMapping.ModifiedOld, accumulator: T): T {
            var current = accumulator
            current = visitReturningMappingModifiedOld(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkReturningMappingAllNew(node: PartiqlAst.ReturningMapping.AllNew, accumulator: T): T {
            var current = accumulator
            current = visitReturningMappingAllNew(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkReturningMappingAllOld(node: PartiqlAst.ReturningMapping.AllOld, accumulator: T): T {
            var current = accumulator
            current = visitReturningMappingAllOld(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: Type
        //////////////////////////////////////
        open fun walkType(node: PartiqlAst.Type, accumulator: T): T {
            val current = visitType(node, accumulator)
            return when(node) {
                is PartiqlAst.Type.NullType -> walkTypeNullType(node, current)
                is PartiqlAst.Type.BooleanType -> walkTypeBooleanType(node, current)
                is PartiqlAst.Type.SmallintType -> walkTypeSmallintType(node, current)
                is PartiqlAst.Type.Integer4Type -> walkTypeInteger4Type(node, current)
                is PartiqlAst.Type.Integer8Type -> walkTypeInteger8Type(node, current)
                is PartiqlAst.Type.IntegerType -> walkTypeIntegerType(node, current)
                is PartiqlAst.Type.FloatType -> walkTypeFloatType(node, current)
                is PartiqlAst.Type.RealType -> walkTypeRealType(node, current)
                is PartiqlAst.Type.DoublePrecisionType -> walkTypeDoublePrecisionType(node, current)
                is PartiqlAst.Type.DecimalType -> walkTypeDecimalType(node, current)
                is PartiqlAst.Type.NumericType -> walkTypeNumericType(node, current)
                is PartiqlAst.Type.TimestampType -> walkTypeTimestampType(node, current)
                is PartiqlAst.Type.CharacterType -> walkTypeCharacterType(node, current)
                is PartiqlAst.Type.CharacterVaryingType -> walkTypeCharacterVaryingType(node, current)
                is PartiqlAst.Type.MissingType -> walkTypeMissingType(node, current)
                is PartiqlAst.Type.StringType -> walkTypeStringType(node, current)
                is PartiqlAst.Type.SymbolType -> walkTypeSymbolType(node, current)
                is PartiqlAst.Type.BlobType -> walkTypeBlobType(node, current)
                is PartiqlAst.Type.ClobType -> walkTypeClobType(node, current)
                is PartiqlAst.Type.DateType -> walkTypeDateType(node, current)
                is PartiqlAst.Type.TimeType -> walkTypeTimeType(node, current)
                is PartiqlAst.Type.TimeWithTimeZoneType -> walkTypeTimeWithTimeZoneType(node, current)
                is PartiqlAst.Type.StructType -> walkTypeStructType(node, current)
                is PartiqlAst.Type.TupleType -> walkTypeTupleType(node, current)
                is PartiqlAst.Type.ListType -> walkTypeListType(node, current)
                is PartiqlAst.Type.SexpType -> walkTypeSexpType(node, current)
                is PartiqlAst.Type.BagType -> walkTypeBagType(node, current)
                is PartiqlAst.Type.AnyType -> walkTypeAnyType(node, current)
                is PartiqlAst.Type.CustomType -> walkTypeCustomType(node, current)
            }
        }
    
        open fun walkTypeNullType(node: PartiqlAst.Type.NullType, accumulator: T): T {
            var current = accumulator
            current = visitTypeNullType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeBooleanType(node: PartiqlAst.Type.BooleanType, accumulator: T): T {
            var current = accumulator
            current = visitTypeBooleanType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeSmallintType(node: PartiqlAst.Type.SmallintType, accumulator: T): T {
            var current = accumulator
            current = visitTypeSmallintType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeInteger4Type(node: PartiqlAst.Type.Integer4Type, accumulator: T): T {
            var current = accumulator
            current = visitTypeInteger4Type(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeInteger8Type(node: PartiqlAst.Type.Integer8Type, accumulator: T): T {
            var current = accumulator
            current = visitTypeInteger8Type(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeIntegerType(node: PartiqlAst.Type.IntegerType, accumulator: T): T {
            var current = accumulator
            current = visitTypeIntegerType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeFloatType(node: PartiqlAst.Type.FloatType, accumulator: T): T {
            var current = accumulator
            current = visitTypeFloatType(node, current)
            node.precision?.let { current = walkLongPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeRealType(node: PartiqlAst.Type.RealType, accumulator: T): T {
            var current = accumulator
            current = visitTypeRealType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeDoublePrecisionType(node: PartiqlAst.Type.DoublePrecisionType, accumulator: T): T {
            var current = accumulator
            current = visitTypeDoublePrecisionType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeDecimalType(node: PartiqlAst.Type.DecimalType, accumulator: T): T {
            var current = accumulator
            current = visitTypeDecimalType(node, current)
            node.precision?.let { current = walkLongPrimitive(it, current) }
            node.scale?.let { current = walkLongPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeNumericType(node: PartiqlAst.Type.NumericType, accumulator: T): T {
            var current = accumulator
            current = visitTypeNumericType(node, current)
            node.precision?.let { current = walkLongPrimitive(it, current) }
            node.scale?.let { current = walkLongPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeTimestampType(node: PartiqlAst.Type.TimestampType, accumulator: T): T {
            var current = accumulator
            current = visitTypeTimestampType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeCharacterType(node: PartiqlAst.Type.CharacterType, accumulator: T): T {
            var current = accumulator
            current = visitTypeCharacterType(node, current)
            node.length?.let { current = walkLongPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeCharacterVaryingType(node: PartiqlAst.Type.CharacterVaryingType, accumulator: T): T {
            var current = accumulator
            current = visitTypeCharacterVaryingType(node, current)
            node.length?.let { current = walkLongPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeMissingType(node: PartiqlAst.Type.MissingType, accumulator: T): T {
            var current = accumulator
            current = visitTypeMissingType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeStringType(node: PartiqlAst.Type.StringType, accumulator: T): T {
            var current = accumulator
            current = visitTypeStringType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeSymbolType(node: PartiqlAst.Type.SymbolType, accumulator: T): T {
            var current = accumulator
            current = visitTypeSymbolType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeBlobType(node: PartiqlAst.Type.BlobType, accumulator: T): T {
            var current = accumulator
            current = visitTypeBlobType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeClobType(node: PartiqlAst.Type.ClobType, accumulator: T): T {
            var current = accumulator
            current = visitTypeClobType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeDateType(node: PartiqlAst.Type.DateType, accumulator: T): T {
            var current = accumulator
            current = visitTypeDateType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeTimeType(node: PartiqlAst.Type.TimeType, accumulator: T): T {
            var current = accumulator
            current = visitTypeTimeType(node, current)
            node.precision?.let { current = walkLongPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeTimeWithTimeZoneType(node: PartiqlAst.Type.TimeWithTimeZoneType, accumulator: T): T {
            var current = accumulator
            current = visitTypeTimeWithTimeZoneType(node, current)
            node.precision?.let { current = walkLongPrimitive(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeStructType(node: PartiqlAst.Type.StructType, accumulator: T): T {
            var current = accumulator
            current = visitTypeStructType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeTupleType(node: PartiqlAst.Type.TupleType, accumulator: T): T {
            var current = accumulator
            current = visitTypeTupleType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeListType(node: PartiqlAst.Type.ListType, accumulator: T): T {
            var current = accumulator
            current = visitTypeListType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeSexpType(node: PartiqlAst.Type.SexpType, accumulator: T): T {
            var current = accumulator
            current = visitTypeSexpType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeBagType(node: PartiqlAst.Type.BagType, accumulator: T): T {
            var current = accumulator
            current = visitTypeBagType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeAnyType(node: PartiqlAst.Type.AnyType, accumulator: T): T {
            var current = accumulator
            current = visitTypeAnyType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeCustomType(node: PartiqlAst.Type.CustomType, accumulator: T): T {
            var current = accumulator
            current = visitTypeCustomType(node, current)
            current = walkSymbolPrimitive(node.name, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
    }
    abstract class VisitorTransform : DomainVisitorTransformBase() {
        //////////////////////////////////////
        // Tuple Types
        //////////////////////////////////////
        // Tuple TimeValue
        open fun transformTimeValue(node: PartiqlAst.TimeValue): PartiqlAst.TimeValue {
            val new_hour = transformTimeValue_hour(node)
            val new_minute = transformTimeValue_minute(node)
            val new_second = transformTimeValue_second(node)
            val new_nano = transformTimeValue_nano(node)
            val new_precision = transformTimeValue_precision(node)
            val new_withTimeZone = transformTimeValue_withTimeZone(node)
            val new_tzMinutes = transformTimeValue_tzMinutes(node)
            val new_metas = transformTimeValue_metas(node)
            return if (
                node.hour !== new_hour ||
                node.minute !== new_minute ||
                node.second !== new_second ||
                node.nano !== new_nano ||
                node.precision !== new_precision ||
                node.withTimeZone !== new_withTimeZone ||
                node.tzMinutes !== new_tzMinutes ||
                node.metas !== new_metas
            ) {
                PartiqlAst.TimeValue(
                    hour = new_hour,
                    minute = new_minute,
                    second = new_second,
                    nano = new_nano,
                    precision = new_precision,
                    withTimeZone = new_withTimeZone,
                    tzMinutes = new_tzMinutes,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTimeValue_hour(node: PartiqlAst.TimeValue) =
            transformLongPrimitive(node.hour)
        open fun transformTimeValue_minute(node: PartiqlAst.TimeValue) =
            transformLongPrimitive(node.minute)
        open fun transformTimeValue_second(node: PartiqlAst.TimeValue) =
            transformLongPrimitive(node.second)
        open fun transformTimeValue_nano(node: PartiqlAst.TimeValue) =
            transformLongPrimitive(node.nano)
        open fun transformTimeValue_precision(node: PartiqlAst.TimeValue) =
            transformLongPrimitive(node.precision)
        open fun transformTimeValue_withTimeZone(node: PartiqlAst.TimeValue) =
            transformBoolPrimitive(node.withTimeZone)
        open fun transformTimeValue_tzMinutes(node: PartiqlAst.TimeValue) =
            node.tzMinutes?.let { transformLongPrimitive(it) }
        open fun transformTimeValue_metas(node: PartiqlAst.TimeValue) =
            transformMetas(node.metas)
    
        // Tuple Let
        open fun transformLet(node: PartiqlAst.Let): PartiqlAst.Let {
            val new_letBindings = transformLet_letBindings(node)
            val new_metas = transformLet_metas(node)
            return if (
                node.letBindings !== new_letBindings ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Let(
                    letBindings = new_letBindings,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformLet_letBindings(node: PartiqlAst.Let) =
            node.letBindings.map { transformLetBinding(it) }
        open fun transformLet_metas(node: PartiqlAst.Let) =
            transformMetas(node.metas)
    
        // Tuple LetBinding
        open fun transformLetBinding(node: PartiqlAst.LetBinding): PartiqlAst.LetBinding {
            val new_expr = transformLetBinding_expr(node)
            val new_name = transformLetBinding_name(node)
            val new_metas = transformLetBinding_metas(node)
            return if (
                node.expr !== new_expr ||
                node.name !== new_name ||
                node.metas !== new_metas
            ) {
                PartiqlAst.LetBinding(
                    expr = new_expr,
                    name = new_name,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformLetBinding_expr(node: PartiqlAst.LetBinding) =
            transformExpr(node.expr)
        open fun transformLetBinding_name(node: PartiqlAst.LetBinding) =
            transformSymbolPrimitive(node.name)
        open fun transformLetBinding_metas(node: PartiqlAst.LetBinding) =
            transformMetas(node.metas)
    
        // Tuple GraphMatchQuantifier
        open fun transformGraphMatchQuantifier(node: PartiqlAst.GraphMatchQuantifier): PartiqlAst.GraphMatchQuantifier {
            val new_lower = transformGraphMatchQuantifier_lower(node)
            val new_upper = transformGraphMatchQuantifier_upper(node)
            val new_metas = transformGraphMatchQuantifier_metas(node)
            return if (
                node.lower !== new_lower ||
                node.upper !== new_upper ||
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchQuantifier(
                    lower = new_lower,
                    upper = new_upper,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchQuantifier_lower(node: PartiqlAst.GraphMatchQuantifier) =
            transformLongPrimitive(node.lower)
        open fun transformGraphMatchQuantifier_upper(node: PartiqlAst.GraphMatchQuantifier) =
            node.upper?.let { transformLongPrimitive(it) }
        open fun transformGraphMatchQuantifier_metas(node: PartiqlAst.GraphMatchQuantifier) =
            transformMetas(node.metas)
    
        // Tuple GraphMatchPattern
        open fun transformGraphMatchPattern(node: PartiqlAst.GraphMatchPattern): PartiqlAst.GraphMatchPattern {
            val new_restrictor = transformGraphMatchPattern_restrictor(node)
            val new_prefilter = transformGraphMatchPattern_prefilter(node)
            val new_variable = transformGraphMatchPattern_variable(node)
            val new_quantifier = transformGraphMatchPattern_quantifier(node)
            val new_parts = transformGraphMatchPattern_parts(node)
            val new_metas = transformGraphMatchPattern_metas(node)
            return if (
                node.restrictor !== new_restrictor ||
                node.prefilter !== new_prefilter ||
                node.variable !== new_variable ||
                node.quantifier !== new_quantifier ||
                node.parts !== new_parts ||
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchPattern(
                    restrictor = new_restrictor,
                    prefilter = new_prefilter,
                    variable = new_variable,
                    quantifier = new_quantifier,
                    parts = new_parts,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchPattern_restrictor(node: PartiqlAst.GraphMatchPattern) =
            node.restrictor?.let { transformGraphMatchRestrictor(it) }
        open fun transformGraphMatchPattern_prefilter(node: PartiqlAst.GraphMatchPattern) =
            node.prefilter?.let { transformExpr(it) }
        open fun transformGraphMatchPattern_variable(node: PartiqlAst.GraphMatchPattern) =
            node.variable?.let { transformSymbolPrimitive(it) }
        open fun transformGraphMatchPattern_quantifier(node: PartiqlAst.GraphMatchPattern) =
            node.quantifier?.let { transformGraphMatchQuantifier(it) }
        open fun transformGraphMatchPattern_parts(node: PartiqlAst.GraphMatchPattern) =
            node.parts.map { transformGraphMatchPatternPart(it) }
        open fun transformGraphMatchPattern_metas(node: PartiqlAst.GraphMatchPattern) =
            transformMetas(node.metas)
    
        // Tuple GpmlPattern
        open fun transformGpmlPattern(node: PartiqlAst.GpmlPattern): PartiqlAst.GpmlPattern {
            val new_selector = transformGpmlPattern_selector(node)
            val new_patterns = transformGpmlPattern_patterns(node)
            val new_metas = transformGpmlPattern_metas(node)
            return if (
                node.selector !== new_selector ||
                node.patterns !== new_patterns ||
                node.metas !== new_metas
            ) {
                PartiqlAst.GpmlPattern(
                    selector = new_selector,
                    patterns = new_patterns,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGpmlPattern_selector(node: PartiqlAst.GpmlPattern) =
            node.selector?.let { transformGraphMatchSelector(it) }
        open fun transformGpmlPattern_patterns(node: PartiqlAst.GpmlPattern) =
            node.patterns.map { transformGraphMatchPattern(it) }
        open fun transformGpmlPattern_metas(node: PartiqlAst.GpmlPattern) =
            transformMetas(node.metas)
    
        // Tuple ExprPair
        open fun transformExprPair(node: PartiqlAst.ExprPair): PartiqlAst.ExprPair {
            val new_first = transformExprPair_first(node)
            val new_second = transformExprPair_second(node)
            val new_metas = transformExprPair_metas(node)
            return if (
                node.first !== new_first ||
                node.second !== new_second ||
                node.metas !== new_metas
            ) {
                PartiqlAst.ExprPair(
                    first = new_first,
                    second = new_second,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprPair_first(node: PartiqlAst.ExprPair) =
            transformExpr(node.first)
        open fun transformExprPair_second(node: PartiqlAst.ExprPair) =
            transformExpr(node.second)
        open fun transformExprPair_metas(node: PartiqlAst.ExprPair) =
            transformMetas(node.metas)
    
        // Tuple ExprPairList
        open fun transformExprPairList(node: PartiqlAst.ExprPairList): PartiqlAst.ExprPairList {
            val new_pairs = transformExprPairList_pairs(node)
            val new_metas = transformExprPairList_metas(node)
            return if (
                node.pairs !== new_pairs ||
                node.metas !== new_metas
            ) {
                PartiqlAst.ExprPairList(
                    pairs = new_pairs,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprPairList_pairs(node: PartiqlAst.ExprPairList) =
            node.pairs.map { transformExprPair(it) }
        open fun transformExprPairList_metas(node: PartiqlAst.ExprPairList) =
            transformMetas(node.metas)
    
        // Tuple GroupBy
        open fun transformGroupBy(node: PartiqlAst.GroupBy): PartiqlAst.GroupBy {
            val new_strategy = transformGroupBy_strategy(node)
            val new_keyList = transformGroupBy_keyList(node)
            val new_groupAsAlias = transformGroupBy_groupAsAlias(node)
            val new_metas = transformGroupBy_metas(node)
            return if (
                node.strategy !== new_strategy ||
                node.keyList !== new_keyList ||
                node.groupAsAlias !== new_groupAsAlias ||
                node.metas !== new_metas
            ) {
                PartiqlAst.GroupBy(
                    strategy = new_strategy,
                    keyList = new_keyList,
                    groupAsAlias = new_groupAsAlias,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGroupBy_strategy(node: PartiqlAst.GroupBy) =
            transformGroupingStrategy(node.strategy)
        open fun transformGroupBy_keyList(node: PartiqlAst.GroupBy) =
            transformGroupKeyList(node.keyList)
        open fun transformGroupBy_groupAsAlias(node: PartiqlAst.GroupBy) =
            node.groupAsAlias?.let { transformSymbolPrimitive(it) }
        open fun transformGroupBy_metas(node: PartiqlAst.GroupBy) =
            transformMetas(node.metas)
    
        // Tuple GroupKeyList
        open fun transformGroupKeyList(node: PartiqlAst.GroupKeyList): PartiqlAst.GroupKeyList {
            val new_keys = transformGroupKeyList_keys(node)
            val new_metas = transformGroupKeyList_metas(node)
            return if (
                node.keys !== new_keys ||
                node.metas !== new_metas
            ) {
                PartiqlAst.GroupKeyList(
                    keys = new_keys,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGroupKeyList_keys(node: PartiqlAst.GroupKeyList) =
            node.keys.map { transformGroupKey(it) }
        open fun transformGroupKeyList_metas(node: PartiqlAst.GroupKeyList) =
            transformMetas(node.metas)
    
        // Tuple GroupKey
        open fun transformGroupKey(node: PartiqlAst.GroupKey): PartiqlAst.GroupKey {
            val new_expr = transformGroupKey_expr(node)
            val new_asAlias = transformGroupKey_asAlias(node)
            val new_metas = transformGroupKey_metas(node)
            return if (
                node.expr !== new_expr ||
                node.asAlias !== new_asAlias ||
                node.metas !== new_metas
            ) {
                PartiqlAst.GroupKey(
                    expr = new_expr,
                    asAlias = new_asAlias,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGroupKey_expr(node: PartiqlAst.GroupKey) =
            transformExpr(node.expr)
        open fun transformGroupKey_asAlias(node: PartiqlAst.GroupKey) =
            node.asAlias?.let { transformSymbolPrimitive(it) }
        open fun transformGroupKey_metas(node: PartiqlAst.GroupKey) =
            transformMetas(node.metas)
    
        // Tuple OrderBy
        open fun transformOrderBy(node: PartiqlAst.OrderBy): PartiqlAst.OrderBy {
            val new_sortSpecs = transformOrderBy_sortSpecs(node)
            val new_metas = transformOrderBy_metas(node)
            return if (
                node.sortSpecs !== new_sortSpecs ||
                node.metas !== new_metas
            ) {
                PartiqlAst.OrderBy(
                    sortSpecs = new_sortSpecs,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformOrderBy_sortSpecs(node: PartiqlAst.OrderBy) =
            node.sortSpecs.map { transformSortSpec(it) }
        open fun transformOrderBy_metas(node: PartiqlAst.OrderBy) =
            transformMetas(node.metas)
    
        // Tuple SortSpec
        open fun transformSortSpec(node: PartiqlAst.SortSpec): PartiqlAst.SortSpec {
            val new_expr = transformSortSpec_expr(node)
            val new_orderingSpec = transformSortSpec_orderingSpec(node)
            val new_nullsSpec = transformSortSpec_nullsSpec(node)
            val new_metas = transformSortSpec_metas(node)
            return if (
                node.expr !== new_expr ||
                node.orderingSpec !== new_orderingSpec ||
                node.nullsSpec !== new_nullsSpec ||
                node.metas !== new_metas
            ) {
                PartiqlAst.SortSpec(
                    expr = new_expr,
                    orderingSpec = new_orderingSpec,
                    nullsSpec = new_nullsSpec,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformSortSpec_expr(node: PartiqlAst.SortSpec) =
            transformExpr(node.expr)
        open fun transformSortSpec_orderingSpec(node: PartiqlAst.SortSpec) =
            node.orderingSpec?.let { transformOrderingSpec(it) }
        open fun transformSortSpec_nullsSpec(node: PartiqlAst.SortSpec) =
            node.nullsSpec?.let { transformNullsSpec(it) }
        open fun transformSortSpec_metas(node: PartiqlAst.SortSpec) =
            transformMetas(node.metas)
    
        // Tuple Over
        open fun transformOver(node: PartiqlAst.Over): PartiqlAst.Over {
            val new_partitionBy = transformOver_partitionBy(node)
            val new_orderBy = transformOver_orderBy(node)
            val new_metas = transformOver_metas(node)
            return if (
                node.partitionBy !== new_partitionBy ||
                node.orderBy !== new_orderBy ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Over(
                    partitionBy = new_partitionBy,
                    orderBy = new_orderBy,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformOver_partitionBy(node: PartiqlAst.Over) =
            node.partitionBy?.let { transformWindowPartitionList(it) }
        open fun transformOver_orderBy(node: PartiqlAst.Over) =
            node.orderBy?.let { transformWindowSortSpecList(it) }
        open fun transformOver_metas(node: PartiqlAst.Over) =
            transformMetas(node.metas)
    
        // Tuple WindowPartitionList
        open fun transformWindowPartitionList(node: PartiqlAst.WindowPartitionList): PartiqlAst.WindowPartitionList {
            val new_exprs = transformWindowPartitionList_exprs(node)
            val new_metas = transformWindowPartitionList_metas(node)
            return if (
                node.exprs !== new_exprs ||
                node.metas !== new_metas
            ) {
                PartiqlAst.WindowPartitionList(
                    exprs = new_exprs,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformWindowPartitionList_exprs(node: PartiqlAst.WindowPartitionList) =
            node.exprs.map { transformExpr(it) }
        open fun transformWindowPartitionList_metas(node: PartiqlAst.WindowPartitionList) =
            transformMetas(node.metas)
    
        // Tuple WindowSortSpecList
        open fun transformWindowSortSpecList(node: PartiqlAst.WindowSortSpecList): PartiqlAst.WindowSortSpecList {
            val new_sortSpecs = transformWindowSortSpecList_sortSpecs(node)
            val new_metas = transformWindowSortSpecList_metas(node)
            return if (
                node.sortSpecs !== new_sortSpecs ||
                node.metas !== new_metas
            ) {
                PartiqlAst.WindowSortSpecList(
                    sortSpecs = new_sortSpecs,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformWindowSortSpecList_sortSpecs(node: PartiqlAst.WindowSortSpecList) =
            node.sortSpecs.map { transformSortSpec(it) }
        open fun transformWindowSortSpecList_metas(node: PartiqlAst.WindowSortSpecList) =
            transformMetas(node.metas)
    
        // Tuple DmlOpList
        open fun transformDmlOpList(node: PartiqlAst.DmlOpList): PartiqlAst.DmlOpList {
            val new_ops = transformDmlOpList_ops(node)
            val new_metas = transformDmlOpList_metas(node)
            return if (
                node.ops !== new_ops ||
                node.metas !== new_metas
            ) {
                PartiqlAst.DmlOpList(
                    ops = new_ops,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformDmlOpList_ops(node: PartiqlAst.DmlOpList) =
            node.ops.map { transformDmlOp(it) }
        open fun transformDmlOpList_metas(node: PartiqlAst.DmlOpList) =
            transformMetas(node.metas)
    
        // Tuple OnConflict
        open fun transformOnConflict(node: PartiqlAst.OnConflict): PartiqlAst.OnConflict {
            val new_expr = transformOnConflict_expr(node)
            val new_conflictAction = transformOnConflict_conflictAction(node)
            val new_metas = transformOnConflict_metas(node)
            return if (
                node.expr !== new_expr ||
                node.conflictAction !== new_conflictAction ||
                node.metas !== new_metas
            ) {
                PartiqlAst.OnConflict(
                    expr = new_expr,
                    conflictAction = new_conflictAction,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformOnConflict_expr(node: PartiqlAst.OnConflict) =
            transformExpr(node.expr)
        open fun transformOnConflict_conflictAction(node: PartiqlAst.OnConflict) =
            transformConflictAction(node.conflictAction)
        open fun transformOnConflict_metas(node: PartiqlAst.OnConflict) =
            transformMetas(node.metas)
    
        // Tuple ReturningExpr
        open fun transformReturningExpr(node: PartiqlAst.ReturningExpr): PartiqlAst.ReturningExpr {
            val new_elems = transformReturningExpr_elems(node)
            val new_metas = transformReturningExpr_metas(node)
            return if (
                node.elems !== new_elems ||
                node.metas !== new_metas
            ) {
                PartiqlAst.ReturningExpr(
                    elems = new_elems,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformReturningExpr_elems(node: PartiqlAst.ReturningExpr) =
            node.elems.map { transformReturningElem(it) }
        open fun transformReturningExpr_metas(node: PartiqlAst.ReturningExpr) =
            transformMetas(node.metas)
    
        // Tuple ReturningElem
        open fun transformReturningElem(node: PartiqlAst.ReturningElem): PartiqlAst.ReturningElem {
            val new_mapping = transformReturningElem_mapping(node)
            val new_column = transformReturningElem_column(node)
            val new_metas = transformReturningElem_metas(node)
            return if (
                node.mapping !== new_mapping ||
                node.column !== new_column ||
                node.metas !== new_metas
            ) {
                PartiqlAst.ReturningElem(
                    mapping = new_mapping,
                    column = new_column,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformReturningElem_mapping(node: PartiqlAst.ReturningElem) =
            transformReturningMapping(node.mapping)
        open fun transformReturningElem_column(node: PartiqlAst.ReturningElem) =
            transformColumnComponent(node.column)
        open fun transformReturningElem_metas(node: PartiqlAst.ReturningElem) =
            transformMetas(node.metas)
    
        // Tuple Identifier
        open fun transformIdentifier(node: PartiqlAst.Identifier): PartiqlAst.Identifier {
            val new_name = transformIdentifier_name(node)
            val new_case = transformIdentifier_case(node)
            val new_metas = transformIdentifier_metas(node)
            return if (
                node.name !== new_name ||
                node.case !== new_case ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Identifier(
                    name = new_name,
                    case = new_case,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformIdentifier_name(node: PartiqlAst.Identifier) =
            transformSymbolPrimitive(node.name)
        open fun transformIdentifier_case(node: PartiqlAst.Identifier) =
            transformCaseSensitivity(node.case)
        open fun transformIdentifier_metas(node: PartiqlAst.Identifier) =
            transformMetas(node.metas)
    
        // Tuple Assignment
        open fun transformAssignment(node: PartiqlAst.Assignment): PartiqlAst.Assignment {
            val new_target = transformAssignment_target(node)
            val new_value = transformAssignment_value(node)
            val new_metas = transformAssignment_metas(node)
            return if (
                node.target !== new_target ||
                node.value !== new_value ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Assignment(
                    target = new_target,
                    value = new_value,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformAssignment_target(node: PartiqlAst.Assignment) =
            transformExpr(node.target)
        open fun transformAssignment_value(node: PartiqlAst.Assignment) =
            transformExpr(node.value)
        open fun transformAssignment_metas(node: PartiqlAst.Assignment) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: Statement
        //////////////////////////////////////
        open fun transformStatement(node: PartiqlAst.Statement): PartiqlAst.Statement =
            when(node) {
                is PartiqlAst.Statement.Query -> transformStatementQuery(node)
                is PartiqlAst.Statement.Dml -> transformStatementDml(node)
                is PartiqlAst.Statement.Ddl -> transformStatementDdl(node)
                is PartiqlAst.Statement.Exec -> transformStatementExec(node)
                is PartiqlAst.Statement.Explain -> transformStatementExplain(node)
            }
        // Variant StatementQuery
        open fun transformStatementQuery(node: PartiqlAst.Statement.Query): PartiqlAst.Statement {
            val new_expr = transformStatementQuery_expr(node)
            val new_metas = transformStatementQuery_metas(node)
            return if (
                node.expr !== new_expr ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Statement.Query(
                    expr = new_expr,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformStatementQuery_expr(node: PartiqlAst.Statement.Query) =
            transformExpr(node.expr)
        open fun transformStatementQuery_metas(node: PartiqlAst.Statement.Query) =
            transformMetas(node.metas)
    
        // Variant StatementDml
        open fun transformStatementDml(node: PartiqlAst.Statement.Dml): PartiqlAst.Statement {
            val new_operations = transformStatementDml_operations(node)
            val new_from = transformStatementDml_from(node)
            val new_where = transformStatementDml_where(node)
            val new_returning = transformStatementDml_returning(node)
            val new_metas = transformStatementDml_metas(node)
            return if (
                node.operations !== new_operations ||
                node.from !== new_from ||
                node.where !== new_where ||
                node.returning !== new_returning ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Statement.Dml(
                    operations = new_operations,
                    from = new_from,
                    where = new_where,
                    returning = new_returning,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformStatementDml_operations(node: PartiqlAst.Statement.Dml) =
            transformDmlOpList(node.operations)
        open fun transformStatementDml_from(node: PartiqlAst.Statement.Dml) =
            node.from?.let { transformFromSource(it) }
        open fun transformStatementDml_where(node: PartiqlAst.Statement.Dml) =
            node.where?.let { transformExpr(it) }
        open fun transformStatementDml_returning(node: PartiqlAst.Statement.Dml) =
            node.returning?.let { transformReturningExpr(it) }
        open fun transformStatementDml_metas(node: PartiqlAst.Statement.Dml) =
            transformMetas(node.metas)
    
        // Variant StatementDdl
        open fun transformStatementDdl(node: PartiqlAst.Statement.Ddl): PartiqlAst.Statement {
            val new_op = transformStatementDdl_op(node)
            val new_metas = transformStatementDdl_metas(node)
            return if (
                node.op !== new_op ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Statement.Ddl(
                    op = new_op,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformStatementDdl_op(node: PartiqlAst.Statement.Ddl) =
            transformDdlOp(node.op)
        open fun transformStatementDdl_metas(node: PartiqlAst.Statement.Ddl) =
            transformMetas(node.metas)
    
        // Variant StatementExec
        open fun transformStatementExec(node: PartiqlAst.Statement.Exec): PartiqlAst.Statement {
            val new_procedureName = transformStatementExec_procedureName(node)
            val new_args = transformStatementExec_args(node)
            val new_metas = transformStatementExec_metas(node)
            return if (
                node.procedureName !== new_procedureName ||
                node.args !== new_args ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Statement.Exec(
                    procedureName = new_procedureName,
                    args = new_args,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformStatementExec_procedureName(node: PartiqlAst.Statement.Exec) =
            transformSymbolPrimitive(node.procedureName)
        open fun transformStatementExec_args(node: PartiqlAst.Statement.Exec) =
            node.args.map { transformExpr(it) }
        open fun transformStatementExec_metas(node: PartiqlAst.Statement.Exec) =
            transformMetas(node.metas)
    
        // Variant StatementExplain
        open fun transformStatementExplain(node: PartiqlAst.Statement.Explain): PartiqlAst.Statement {
            val new_target = transformStatementExplain_target(node)
            val new_metas = transformStatementExplain_metas(node)
            return if (
                node.target !== new_target ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Statement.Explain(
                    target = new_target,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformStatementExplain_target(node: PartiqlAst.Statement.Explain) =
            transformExplainTarget(node.target)
        open fun transformStatementExplain_metas(node: PartiqlAst.Statement.Explain) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: ExplainTarget
        //////////////////////////////////////
        open fun transformExplainTarget(node: PartiqlAst.ExplainTarget): PartiqlAst.ExplainTarget =
            when(node) {
                is PartiqlAst.ExplainTarget.Domain -> transformExplainTargetDomain(node)
            }
        // Variant ExplainTargetDomain
        open fun transformExplainTargetDomain(node: PartiqlAst.ExplainTarget.Domain): PartiqlAst.ExplainTarget {
            val new_statement = transformExplainTargetDomain_statement(node)
            val new_type = transformExplainTargetDomain_type(node)
            val new_format = transformExplainTargetDomain_format(node)
            val new_metas = transformExplainTargetDomain_metas(node)
            return if (
                node.statement !== new_statement ||
                node.type !== new_type ||
                node.format !== new_format ||
                node.metas !== new_metas
            ) {
                PartiqlAst.ExplainTarget.Domain(
                    statement = new_statement,
                    type = new_type,
                    format = new_format,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExplainTargetDomain_statement(node: PartiqlAst.ExplainTarget.Domain) =
            transformStatement(node.statement)
        open fun transformExplainTargetDomain_type(node: PartiqlAst.ExplainTarget.Domain) =
            node.type?.let { transformSymbolPrimitive(it) }
        open fun transformExplainTargetDomain_format(node: PartiqlAst.ExplainTarget.Domain) =
            node.format?.let { transformSymbolPrimitive(it) }
        open fun transformExplainTargetDomain_metas(node: PartiqlAst.ExplainTarget.Domain) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: Expr
        //////////////////////////////////////
        open fun transformExpr(node: PartiqlAst.Expr): PartiqlAst.Expr =
            when(node) {
                is PartiqlAst.Expr.Missing -> transformExprMissing(node)
                is PartiqlAst.Expr.Lit -> transformExprLit(node)
                is PartiqlAst.Expr.Id -> transformExprId(node)
                is PartiqlAst.Expr.Parameter -> transformExprParameter(node)
                is PartiqlAst.Expr.Not -> transformExprNot(node)
                is PartiqlAst.Expr.Pos -> transformExprPos(node)
                is PartiqlAst.Expr.Neg -> transformExprNeg(node)
                is PartiqlAst.Expr.Plus -> transformExprPlus(node)
                is PartiqlAst.Expr.Minus -> transformExprMinus(node)
                is PartiqlAst.Expr.Times -> transformExprTimes(node)
                is PartiqlAst.Expr.Divide -> transformExprDivide(node)
                is PartiqlAst.Expr.Modulo -> transformExprModulo(node)
                is PartiqlAst.Expr.Concat -> transformExprConcat(node)
                is PartiqlAst.Expr.And -> transformExprAnd(node)
                is PartiqlAst.Expr.Or -> transformExprOr(node)
                is PartiqlAst.Expr.Eq -> transformExprEq(node)
                is PartiqlAst.Expr.Ne -> transformExprNe(node)
                is PartiqlAst.Expr.Gt -> transformExprGt(node)
                is PartiqlAst.Expr.Gte -> transformExprGte(node)
                is PartiqlAst.Expr.Lt -> transformExprLt(node)
                is PartiqlAst.Expr.Lte -> transformExprLte(node)
                is PartiqlAst.Expr.Like -> transformExprLike(node)
                is PartiqlAst.Expr.Between -> transformExprBetween(node)
                is PartiqlAst.Expr.InCollection -> transformExprInCollection(node)
                is PartiqlAst.Expr.IsType -> transformExprIsType(node)
                is PartiqlAst.Expr.SimpleCase -> transformExprSimpleCase(node)
                is PartiqlAst.Expr.SearchedCase -> transformExprSearchedCase(node)
                is PartiqlAst.Expr.Struct -> transformExprStruct(node)
                is PartiqlAst.Expr.Bag -> transformExprBag(node)
                is PartiqlAst.Expr.List -> transformExprList(node)
                is PartiqlAst.Expr.Sexp -> transformExprSexp(node)
                is PartiqlAst.Expr.Date -> transformExprDate(node)
                is PartiqlAst.Expr.LitTime -> transformExprLitTime(node)
                is PartiqlAst.Expr.BagOp -> transformExprBagOp(node)
                is PartiqlAst.Expr.GraphMatch -> transformExprGraphMatch(node)
                is PartiqlAst.Expr.Path -> transformExprPath(node)
                is PartiqlAst.Expr.Call -> transformExprCall(node)
                is PartiqlAst.Expr.CallAgg -> transformExprCallAgg(node)
                is PartiqlAst.Expr.CallWindow -> transformExprCallWindow(node)
                is PartiqlAst.Expr.Cast -> transformExprCast(node)
                is PartiqlAst.Expr.CanCast -> transformExprCanCast(node)
                is PartiqlAst.Expr.CanLosslessCast -> transformExprCanLosslessCast(node)
                is PartiqlAst.Expr.NullIf -> transformExprNullIf(node)
                is PartiqlAst.Expr.Coalesce -> transformExprCoalesce(node)
                is PartiqlAst.Expr.Select -> transformExprSelect(node)
            }
        // Variant ExprMissing
        open fun transformExprMissing(node: PartiqlAst.Expr.Missing): PartiqlAst.Expr {
            val new_metas = transformExprMissing_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Missing(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprMissing_metas(node: PartiqlAst.Expr.Missing) =
            transformMetas(node.metas)
    
        // Variant ExprLit
        open fun transformExprLit(node: PartiqlAst.Expr.Lit): PartiqlAst.Expr {
            val new_value = transformExprLit_value(node)
            val new_metas = transformExprLit_metas(node)
            return if (
                node.value !== new_value ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Lit(
                    value = new_value,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprLit_value(node: PartiqlAst.Expr.Lit) =
            transformAnyElement(node.value)
        open fun transformExprLit_metas(node: PartiqlAst.Expr.Lit) =
            transformMetas(node.metas)
    
        // Variant ExprId
        open fun transformExprId(node: PartiqlAst.Expr.Id): PartiqlAst.Expr {
            val new_name = transformExprId_name(node)
            val new_case = transformExprId_case(node)
            val new_qualifier = transformExprId_qualifier(node)
            val new_metas = transformExprId_metas(node)
            return if (
                node.name !== new_name ||
                node.case !== new_case ||
                node.qualifier !== new_qualifier ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Id(
                    name = new_name,
                    case = new_case,
                    qualifier = new_qualifier,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprId_name(node: PartiqlAst.Expr.Id) =
            transformSymbolPrimitive(node.name)
        open fun transformExprId_case(node: PartiqlAst.Expr.Id) =
            transformCaseSensitivity(node.case)
        open fun transformExprId_qualifier(node: PartiqlAst.Expr.Id) =
            transformScopeQualifier(node.qualifier)
        open fun transformExprId_metas(node: PartiqlAst.Expr.Id) =
            transformMetas(node.metas)
    
        // Variant ExprParameter
        open fun transformExprParameter(node: PartiqlAst.Expr.Parameter): PartiqlAst.Expr {
            val new_index = transformExprParameter_index(node)
            val new_metas = transformExprParameter_metas(node)
            return if (
                node.index !== new_index ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Parameter(
                    index = new_index,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprParameter_index(node: PartiqlAst.Expr.Parameter) =
            transformLongPrimitive(node.index)
        open fun transformExprParameter_metas(node: PartiqlAst.Expr.Parameter) =
            transformMetas(node.metas)
    
        // Variant ExprNot
        open fun transformExprNot(node: PartiqlAst.Expr.Not): PartiqlAst.Expr {
            val new_expr = transformExprNot_expr(node)
            val new_metas = transformExprNot_metas(node)
            return if (
                node.expr !== new_expr ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Not(
                    expr = new_expr,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprNot_expr(node: PartiqlAst.Expr.Not) =
            transformExpr(node.expr)
        open fun transformExprNot_metas(node: PartiqlAst.Expr.Not) =
            transformMetas(node.metas)
    
        // Variant ExprPos
        open fun transformExprPos(node: PartiqlAst.Expr.Pos): PartiqlAst.Expr {
            val new_expr = transformExprPos_expr(node)
            val new_metas = transformExprPos_metas(node)
            return if (
                node.expr !== new_expr ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Pos(
                    expr = new_expr,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprPos_expr(node: PartiqlAst.Expr.Pos) =
            transformExpr(node.expr)
        open fun transformExprPos_metas(node: PartiqlAst.Expr.Pos) =
            transformMetas(node.metas)
    
        // Variant ExprNeg
        open fun transformExprNeg(node: PartiqlAst.Expr.Neg): PartiqlAst.Expr {
            val new_expr = transformExprNeg_expr(node)
            val new_metas = transformExprNeg_metas(node)
            return if (
                node.expr !== new_expr ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Neg(
                    expr = new_expr,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprNeg_expr(node: PartiqlAst.Expr.Neg) =
            transformExpr(node.expr)
        open fun transformExprNeg_metas(node: PartiqlAst.Expr.Neg) =
            transformMetas(node.metas)
    
        // Variant ExprPlus
        open fun transformExprPlus(node: PartiqlAst.Expr.Plus): PartiqlAst.Expr {
            val new_operands = transformExprPlus_operands(node)
            val new_metas = transformExprPlus_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Plus(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprPlus_operands(node: PartiqlAst.Expr.Plus) =
            node.operands.map { transformExpr(it) }
        open fun transformExprPlus_metas(node: PartiqlAst.Expr.Plus) =
            transformMetas(node.metas)
    
        // Variant ExprMinus
        open fun transformExprMinus(node: PartiqlAst.Expr.Minus): PartiqlAst.Expr {
            val new_operands = transformExprMinus_operands(node)
            val new_metas = transformExprMinus_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Minus(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprMinus_operands(node: PartiqlAst.Expr.Minus) =
            node.operands.map { transformExpr(it) }
        open fun transformExprMinus_metas(node: PartiqlAst.Expr.Minus) =
            transformMetas(node.metas)
    
        // Variant ExprTimes
        open fun transformExprTimes(node: PartiqlAst.Expr.Times): PartiqlAst.Expr {
            val new_operands = transformExprTimes_operands(node)
            val new_metas = transformExprTimes_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Times(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprTimes_operands(node: PartiqlAst.Expr.Times) =
            node.operands.map { transformExpr(it) }
        open fun transformExprTimes_metas(node: PartiqlAst.Expr.Times) =
            transformMetas(node.metas)
    
        // Variant ExprDivide
        open fun transformExprDivide(node: PartiqlAst.Expr.Divide): PartiqlAst.Expr {
            val new_operands = transformExprDivide_operands(node)
            val new_metas = transformExprDivide_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Divide(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprDivide_operands(node: PartiqlAst.Expr.Divide) =
            node.operands.map { transformExpr(it) }
        open fun transformExprDivide_metas(node: PartiqlAst.Expr.Divide) =
            transformMetas(node.metas)
    
        // Variant ExprModulo
        open fun transformExprModulo(node: PartiqlAst.Expr.Modulo): PartiqlAst.Expr {
            val new_operands = transformExprModulo_operands(node)
            val new_metas = transformExprModulo_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Modulo(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprModulo_operands(node: PartiqlAst.Expr.Modulo) =
            node.operands.map { transformExpr(it) }
        open fun transformExprModulo_metas(node: PartiqlAst.Expr.Modulo) =
            transformMetas(node.metas)
    
        // Variant ExprConcat
        open fun transformExprConcat(node: PartiqlAst.Expr.Concat): PartiqlAst.Expr {
            val new_operands = transformExprConcat_operands(node)
            val new_metas = transformExprConcat_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Concat(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprConcat_operands(node: PartiqlAst.Expr.Concat) =
            node.operands.map { transformExpr(it) }
        open fun transformExprConcat_metas(node: PartiqlAst.Expr.Concat) =
            transformMetas(node.metas)
    
        // Variant ExprAnd
        open fun transformExprAnd(node: PartiqlAst.Expr.And): PartiqlAst.Expr {
            val new_operands = transformExprAnd_operands(node)
            val new_metas = transformExprAnd_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.And(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprAnd_operands(node: PartiqlAst.Expr.And) =
            node.operands.map { transformExpr(it) }
        open fun transformExprAnd_metas(node: PartiqlAst.Expr.And) =
            transformMetas(node.metas)
    
        // Variant ExprOr
        open fun transformExprOr(node: PartiqlAst.Expr.Or): PartiqlAst.Expr {
            val new_operands = transformExprOr_operands(node)
            val new_metas = transformExprOr_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Or(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprOr_operands(node: PartiqlAst.Expr.Or) =
            node.operands.map { transformExpr(it) }
        open fun transformExprOr_metas(node: PartiqlAst.Expr.Or) =
            transformMetas(node.metas)
    
        // Variant ExprEq
        open fun transformExprEq(node: PartiqlAst.Expr.Eq): PartiqlAst.Expr {
            val new_operands = transformExprEq_operands(node)
            val new_metas = transformExprEq_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Eq(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprEq_operands(node: PartiqlAst.Expr.Eq) =
            node.operands.map { transformExpr(it) }
        open fun transformExprEq_metas(node: PartiqlAst.Expr.Eq) =
            transformMetas(node.metas)
    
        // Variant ExprNe
        open fun transformExprNe(node: PartiqlAst.Expr.Ne): PartiqlAst.Expr {
            val new_operands = transformExprNe_operands(node)
            val new_metas = transformExprNe_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Ne(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprNe_operands(node: PartiqlAst.Expr.Ne) =
            node.operands.map { transformExpr(it) }
        open fun transformExprNe_metas(node: PartiqlAst.Expr.Ne) =
            transformMetas(node.metas)
    
        // Variant ExprGt
        open fun transformExprGt(node: PartiqlAst.Expr.Gt): PartiqlAst.Expr {
            val new_operands = transformExprGt_operands(node)
            val new_metas = transformExprGt_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Gt(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprGt_operands(node: PartiqlAst.Expr.Gt) =
            node.operands.map { transformExpr(it) }
        open fun transformExprGt_metas(node: PartiqlAst.Expr.Gt) =
            transformMetas(node.metas)
    
        // Variant ExprGte
        open fun transformExprGte(node: PartiqlAst.Expr.Gte): PartiqlAst.Expr {
            val new_operands = transformExprGte_operands(node)
            val new_metas = transformExprGte_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Gte(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprGte_operands(node: PartiqlAst.Expr.Gte) =
            node.operands.map { transformExpr(it) }
        open fun transformExprGte_metas(node: PartiqlAst.Expr.Gte) =
            transformMetas(node.metas)
    
        // Variant ExprLt
        open fun transformExprLt(node: PartiqlAst.Expr.Lt): PartiqlAst.Expr {
            val new_operands = transformExprLt_operands(node)
            val new_metas = transformExprLt_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Lt(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprLt_operands(node: PartiqlAst.Expr.Lt) =
            node.operands.map { transformExpr(it) }
        open fun transformExprLt_metas(node: PartiqlAst.Expr.Lt) =
            transformMetas(node.metas)
    
        // Variant ExprLte
        open fun transformExprLte(node: PartiqlAst.Expr.Lte): PartiqlAst.Expr {
            val new_operands = transformExprLte_operands(node)
            val new_metas = transformExprLte_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Lte(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprLte_operands(node: PartiqlAst.Expr.Lte) =
            node.operands.map { transformExpr(it) }
        open fun transformExprLte_metas(node: PartiqlAst.Expr.Lte) =
            transformMetas(node.metas)
    
        // Variant ExprLike
        open fun transformExprLike(node: PartiqlAst.Expr.Like): PartiqlAst.Expr {
            val new_value = transformExprLike_value(node)
            val new_pattern = transformExprLike_pattern(node)
            val new_escape = transformExprLike_escape(node)
            val new_metas = transformExprLike_metas(node)
            return if (
                node.value !== new_value ||
                node.pattern !== new_pattern ||
                node.escape !== new_escape ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Like(
                    value = new_value,
                    pattern = new_pattern,
                    escape = new_escape,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprLike_value(node: PartiqlAst.Expr.Like) =
            transformExpr(node.value)
        open fun transformExprLike_pattern(node: PartiqlAst.Expr.Like) =
            transformExpr(node.pattern)
        open fun transformExprLike_escape(node: PartiqlAst.Expr.Like) =
            node.escape?.let { transformExpr(it) }
        open fun transformExprLike_metas(node: PartiqlAst.Expr.Like) =
            transformMetas(node.metas)
    
        // Variant ExprBetween
        open fun transformExprBetween(node: PartiqlAst.Expr.Between): PartiqlAst.Expr {
            val new_value = transformExprBetween_value(node)
            val new_from = transformExprBetween_from(node)
            val new_to = transformExprBetween_to(node)
            val new_metas = transformExprBetween_metas(node)
            return if (
                node.value !== new_value ||
                node.from !== new_from ||
                node.to !== new_to ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Between(
                    value = new_value,
                    from = new_from,
                    to = new_to,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprBetween_value(node: PartiqlAst.Expr.Between) =
            transformExpr(node.value)
        open fun transformExprBetween_from(node: PartiqlAst.Expr.Between) =
            transformExpr(node.from)
        open fun transformExprBetween_to(node: PartiqlAst.Expr.Between) =
            transformExpr(node.to)
        open fun transformExprBetween_metas(node: PartiqlAst.Expr.Between) =
            transformMetas(node.metas)
    
        // Variant ExprInCollection
        open fun transformExprInCollection(node: PartiqlAst.Expr.InCollection): PartiqlAst.Expr {
            val new_operands = transformExprInCollection_operands(node)
            val new_metas = transformExprInCollection_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.InCollection(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprInCollection_operands(node: PartiqlAst.Expr.InCollection) =
            node.operands.map { transformExpr(it) }
        open fun transformExprInCollection_metas(node: PartiqlAst.Expr.InCollection) =
            transformMetas(node.metas)
    
        // Variant ExprIsType
        open fun transformExprIsType(node: PartiqlAst.Expr.IsType): PartiqlAst.Expr {
            val new_value = transformExprIsType_value(node)
            val new_type = transformExprIsType_type(node)
            val new_metas = transformExprIsType_metas(node)
            return if (
                node.value !== new_value ||
                node.type !== new_type ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.IsType(
                    value = new_value,
                    type = new_type,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprIsType_value(node: PartiqlAst.Expr.IsType) =
            transformExpr(node.value)
        open fun transformExprIsType_type(node: PartiqlAst.Expr.IsType) =
            transformType(node.type)
        open fun transformExprIsType_metas(node: PartiqlAst.Expr.IsType) =
            transformMetas(node.metas)
    
        // Variant ExprSimpleCase
        open fun transformExprSimpleCase(node: PartiqlAst.Expr.SimpleCase): PartiqlAst.Expr {
            val new_expr = transformExprSimpleCase_expr(node)
            val new_cases = transformExprSimpleCase_cases(node)
            val new_default = transformExprSimpleCase_default(node)
            val new_metas = transformExprSimpleCase_metas(node)
            return if (
                node.expr !== new_expr ||
                node.cases !== new_cases ||
                node.default !== new_default ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.SimpleCase(
                    expr = new_expr,
                    cases = new_cases,
                    default = new_default,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprSimpleCase_expr(node: PartiqlAst.Expr.SimpleCase) =
            transformExpr(node.expr)
        open fun transformExprSimpleCase_cases(node: PartiqlAst.Expr.SimpleCase) =
            transformExprPairList(node.cases)
        open fun transformExprSimpleCase_default(node: PartiqlAst.Expr.SimpleCase) =
            node.default?.let { transformExpr(it) }
        open fun transformExprSimpleCase_metas(node: PartiqlAst.Expr.SimpleCase) =
            transformMetas(node.metas)
    
        // Variant ExprSearchedCase
        open fun transformExprSearchedCase(node: PartiqlAst.Expr.SearchedCase): PartiqlAst.Expr {
            val new_cases = transformExprSearchedCase_cases(node)
            val new_default = transformExprSearchedCase_default(node)
            val new_metas = transformExprSearchedCase_metas(node)
            return if (
                node.cases !== new_cases ||
                node.default !== new_default ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.SearchedCase(
                    cases = new_cases,
                    default = new_default,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprSearchedCase_cases(node: PartiqlAst.Expr.SearchedCase) =
            transformExprPairList(node.cases)
        open fun transformExprSearchedCase_default(node: PartiqlAst.Expr.SearchedCase) =
            node.default?.let { transformExpr(it) }
        open fun transformExprSearchedCase_metas(node: PartiqlAst.Expr.SearchedCase) =
            transformMetas(node.metas)
    
        // Variant ExprStruct
        open fun transformExprStruct(node: PartiqlAst.Expr.Struct): PartiqlAst.Expr {
            val new_fields = transformExprStruct_fields(node)
            val new_metas = transformExprStruct_metas(node)
            return if (
                node.fields !== new_fields ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Struct(
                    fields = new_fields,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprStruct_fields(node: PartiqlAst.Expr.Struct) =
            node.fields.map { transformExprPair(it) }
        open fun transformExprStruct_metas(node: PartiqlAst.Expr.Struct) =
            transformMetas(node.metas)
    
        // Variant ExprBag
        open fun transformExprBag(node: PartiqlAst.Expr.Bag): PartiqlAst.Expr {
            val new_values = transformExprBag_values(node)
            val new_metas = transformExprBag_metas(node)
            return if (
                node.values !== new_values ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Bag(
                    values = new_values,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprBag_values(node: PartiqlAst.Expr.Bag) =
            node.values.map { transformExpr(it) }
        open fun transformExprBag_metas(node: PartiqlAst.Expr.Bag) =
            transformMetas(node.metas)
    
        // Variant ExprList
        open fun transformExprList(node: PartiqlAst.Expr.List): PartiqlAst.Expr {
            val new_values = transformExprList_values(node)
            val new_metas = transformExprList_metas(node)
            return if (
                node.values !== new_values ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.List(
                    values = new_values,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprList_values(node: PartiqlAst.Expr.List) =
            node.values.map { transformExpr(it) }
        open fun transformExprList_metas(node: PartiqlAst.Expr.List) =
            transformMetas(node.metas)
    
        // Variant ExprSexp
        open fun transformExprSexp(node: PartiqlAst.Expr.Sexp): PartiqlAst.Expr {
            val new_values = transformExprSexp_values(node)
            val new_metas = transformExprSexp_metas(node)
            return if (
                node.values !== new_values ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Sexp(
                    values = new_values,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprSexp_values(node: PartiqlAst.Expr.Sexp) =
            node.values.map { transformExpr(it) }
        open fun transformExprSexp_metas(node: PartiqlAst.Expr.Sexp) =
            transformMetas(node.metas)
    
        // Variant ExprDate
        open fun transformExprDate(node: PartiqlAst.Expr.Date): PartiqlAst.Expr {
            val new_year = transformExprDate_year(node)
            val new_month = transformExprDate_month(node)
            val new_day = transformExprDate_day(node)
            val new_metas = transformExprDate_metas(node)
            return if (
                node.year !== new_year ||
                node.month !== new_month ||
                node.day !== new_day ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Date(
                    year = new_year,
                    month = new_month,
                    day = new_day,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprDate_year(node: PartiqlAst.Expr.Date) =
            transformLongPrimitive(node.year)
        open fun transformExprDate_month(node: PartiqlAst.Expr.Date) =
            transformLongPrimitive(node.month)
        open fun transformExprDate_day(node: PartiqlAst.Expr.Date) =
            transformLongPrimitive(node.day)
        open fun transformExprDate_metas(node: PartiqlAst.Expr.Date) =
            transformMetas(node.metas)
    
        // Variant ExprLitTime
        open fun transformExprLitTime(node: PartiqlAst.Expr.LitTime): PartiqlAst.Expr {
            val new_value = transformExprLitTime_value(node)
            val new_metas = transformExprLitTime_metas(node)
            return if (
                node.value !== new_value ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.LitTime(
                    value = new_value,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprLitTime_value(node: PartiqlAst.Expr.LitTime) =
            transformTimeValue(node.value)
        open fun transformExprLitTime_metas(node: PartiqlAst.Expr.LitTime) =
            transformMetas(node.metas)
    
        // Variant ExprBagOp
        open fun transformExprBagOp(node: PartiqlAst.Expr.BagOp): PartiqlAst.Expr {
            val new_op = transformExprBagOp_op(node)
            val new_quantifier = transformExprBagOp_quantifier(node)
            val new_operands = transformExprBagOp_operands(node)
            val new_metas = transformExprBagOp_metas(node)
            return if (
                node.op !== new_op ||
                node.quantifier !== new_quantifier ||
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.BagOp(
                    op = new_op,
                    quantifier = new_quantifier,
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprBagOp_op(node: PartiqlAst.Expr.BagOp) =
            transformBagOpType(node.op)
        open fun transformExprBagOp_quantifier(node: PartiqlAst.Expr.BagOp) =
            transformSetQuantifier(node.quantifier)
        open fun transformExprBagOp_operands(node: PartiqlAst.Expr.BagOp) =
            node.operands.map { transformExpr(it) }
        open fun transformExprBagOp_metas(node: PartiqlAst.Expr.BagOp) =
            transformMetas(node.metas)
    
        // Variant ExprGraphMatch
        open fun transformExprGraphMatch(node: PartiqlAst.Expr.GraphMatch): PartiqlAst.Expr {
            val new_expr = transformExprGraphMatch_expr(node)
            val new_gpmlPattern = transformExprGraphMatch_gpmlPattern(node)
            val new_metas = transformExprGraphMatch_metas(node)
            return if (
                node.expr !== new_expr ||
                node.gpmlPattern !== new_gpmlPattern ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.GraphMatch(
                    expr = new_expr,
                    gpmlPattern = new_gpmlPattern,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprGraphMatch_expr(node: PartiqlAst.Expr.GraphMatch) =
            transformExpr(node.expr)
        open fun transformExprGraphMatch_gpmlPattern(node: PartiqlAst.Expr.GraphMatch) =
            transformGpmlPattern(node.gpmlPattern)
        open fun transformExprGraphMatch_metas(node: PartiqlAst.Expr.GraphMatch) =
            transformMetas(node.metas)
    
        // Variant ExprPath
        open fun transformExprPath(node: PartiqlAst.Expr.Path): PartiqlAst.Expr {
            val new_root = transformExprPath_root(node)
            val new_steps = transformExprPath_steps(node)
            val new_metas = transformExprPath_metas(node)
            return if (
                node.root !== new_root ||
                node.steps !== new_steps ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Path(
                    root = new_root,
                    steps = new_steps,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprPath_root(node: PartiqlAst.Expr.Path) =
            transformExpr(node.root)
        open fun transformExprPath_steps(node: PartiqlAst.Expr.Path) =
            node.steps.map { transformPathStep(it) }
        open fun transformExprPath_metas(node: PartiqlAst.Expr.Path) =
            transformMetas(node.metas)
    
        // Variant ExprCall
        open fun transformExprCall(node: PartiqlAst.Expr.Call): PartiqlAst.Expr {
            val new_funcName = transformExprCall_funcName(node)
            val new_args = transformExprCall_args(node)
            val new_metas = transformExprCall_metas(node)
            return if (
                node.funcName !== new_funcName ||
                node.args !== new_args ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Call(
                    funcName = new_funcName,
                    args = new_args,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprCall_funcName(node: PartiqlAst.Expr.Call) =
            transformSymbolPrimitive(node.funcName)
        open fun transformExprCall_args(node: PartiqlAst.Expr.Call) =
            node.args.map { transformExpr(it) }
        open fun transformExprCall_metas(node: PartiqlAst.Expr.Call) =
            transformMetas(node.metas)
    
        // Variant ExprCallAgg
        open fun transformExprCallAgg(node: PartiqlAst.Expr.CallAgg): PartiqlAst.Expr {
            val new_setq = transformExprCallAgg_setq(node)
            val new_funcName = transformExprCallAgg_funcName(node)
            val new_arg = transformExprCallAgg_arg(node)
            val new_metas = transformExprCallAgg_metas(node)
            return if (
                node.setq !== new_setq ||
                node.funcName !== new_funcName ||
                node.arg !== new_arg ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.CallAgg(
                    setq = new_setq,
                    funcName = new_funcName,
                    arg = new_arg,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprCallAgg_setq(node: PartiqlAst.Expr.CallAgg) =
            transformSetQuantifier(node.setq)
        open fun transformExprCallAgg_funcName(node: PartiqlAst.Expr.CallAgg) =
            transformSymbolPrimitive(node.funcName)
        open fun transformExprCallAgg_arg(node: PartiqlAst.Expr.CallAgg) =
            transformExpr(node.arg)
        open fun transformExprCallAgg_metas(node: PartiqlAst.Expr.CallAgg) =
            transformMetas(node.metas)
    
        // Variant ExprCallWindow
        open fun transformExprCallWindow(node: PartiqlAst.Expr.CallWindow): PartiqlAst.Expr {
            val new_funcName = transformExprCallWindow_funcName(node)
            val new_over = transformExprCallWindow_over(node)
            val new_args = transformExprCallWindow_args(node)
            val new_metas = transformExprCallWindow_metas(node)
            return if (
                node.funcName !== new_funcName ||
                node.over !== new_over ||
                node.args !== new_args ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.CallWindow(
                    funcName = new_funcName,
                    over = new_over,
                    args = new_args,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprCallWindow_funcName(node: PartiqlAst.Expr.CallWindow) =
            transformSymbolPrimitive(node.funcName)
        open fun transformExprCallWindow_over(node: PartiqlAst.Expr.CallWindow) =
            transformOver(node.over)
        open fun transformExprCallWindow_args(node: PartiqlAst.Expr.CallWindow) =
            node.args.map { transformExpr(it) }
        open fun transformExprCallWindow_metas(node: PartiqlAst.Expr.CallWindow) =
            transformMetas(node.metas)
    
        // Variant ExprCast
        open fun transformExprCast(node: PartiqlAst.Expr.Cast): PartiqlAst.Expr {
            val new_value = transformExprCast_value(node)
            val new_asType = transformExprCast_asType(node)
            val new_metas = transformExprCast_metas(node)
            return if (
                node.value !== new_value ||
                node.asType !== new_asType ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Cast(
                    value = new_value,
                    asType = new_asType,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprCast_value(node: PartiqlAst.Expr.Cast) =
            transformExpr(node.value)
        open fun transformExprCast_asType(node: PartiqlAst.Expr.Cast) =
            transformType(node.asType)
        open fun transformExprCast_metas(node: PartiqlAst.Expr.Cast) =
            transformMetas(node.metas)
    
        // Variant ExprCanCast
        open fun transformExprCanCast(node: PartiqlAst.Expr.CanCast): PartiqlAst.Expr {
            val new_value = transformExprCanCast_value(node)
            val new_asType = transformExprCanCast_asType(node)
            val new_metas = transformExprCanCast_metas(node)
            return if (
                node.value !== new_value ||
                node.asType !== new_asType ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.CanCast(
                    value = new_value,
                    asType = new_asType,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprCanCast_value(node: PartiqlAst.Expr.CanCast) =
            transformExpr(node.value)
        open fun transformExprCanCast_asType(node: PartiqlAst.Expr.CanCast) =
            transformType(node.asType)
        open fun transformExprCanCast_metas(node: PartiqlAst.Expr.CanCast) =
            transformMetas(node.metas)
    
        // Variant ExprCanLosslessCast
        open fun transformExprCanLosslessCast(node: PartiqlAst.Expr.CanLosslessCast): PartiqlAst.Expr {
            val new_value = transformExprCanLosslessCast_value(node)
            val new_asType = transformExprCanLosslessCast_asType(node)
            val new_metas = transformExprCanLosslessCast_metas(node)
            return if (
                node.value !== new_value ||
                node.asType !== new_asType ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.CanLosslessCast(
                    value = new_value,
                    asType = new_asType,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprCanLosslessCast_value(node: PartiqlAst.Expr.CanLosslessCast) =
            transformExpr(node.value)
        open fun transformExprCanLosslessCast_asType(node: PartiqlAst.Expr.CanLosslessCast) =
            transformType(node.asType)
        open fun transformExprCanLosslessCast_metas(node: PartiqlAst.Expr.CanLosslessCast) =
            transformMetas(node.metas)
    
        // Variant ExprNullIf
        open fun transformExprNullIf(node: PartiqlAst.Expr.NullIf): PartiqlAst.Expr {
            val new_expr1 = transformExprNullIf_expr1(node)
            val new_expr2 = transformExprNullIf_expr2(node)
            val new_metas = transformExprNullIf_metas(node)
            return if (
                node.expr1 !== new_expr1 ||
                node.expr2 !== new_expr2 ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.NullIf(
                    expr1 = new_expr1,
                    expr2 = new_expr2,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprNullIf_expr1(node: PartiqlAst.Expr.NullIf) =
            transformExpr(node.expr1)
        open fun transformExprNullIf_expr2(node: PartiqlAst.Expr.NullIf) =
            transformExpr(node.expr2)
        open fun transformExprNullIf_metas(node: PartiqlAst.Expr.NullIf) =
            transformMetas(node.metas)
    
        // Variant ExprCoalesce
        open fun transformExprCoalesce(node: PartiqlAst.Expr.Coalesce): PartiqlAst.Expr {
            val new_args = transformExprCoalesce_args(node)
            val new_metas = transformExprCoalesce_metas(node)
            return if (
                node.args !== new_args ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Coalesce(
                    args = new_args,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprCoalesce_args(node: PartiqlAst.Expr.Coalesce) =
            node.args.map { transformExpr(it) }
        open fun transformExprCoalesce_metas(node: PartiqlAst.Expr.Coalesce) =
            transformMetas(node.metas)
    
        // Variant ExprSelect
        open fun transformExprSelect(node: PartiqlAst.Expr.Select): PartiqlAst.Expr {
            val new_setq = transformExprSelect_setq(node)
            val new_project = transformExprSelect_project(node)
            val new_from = transformExprSelect_from(node)
            val new_fromLet = transformExprSelect_fromLet(node)
            val new_where = transformExprSelect_where(node)
            val new_group = transformExprSelect_group(node)
            val new_having = transformExprSelect_having(node)
            val new_order = transformExprSelect_order(node)
            val new_limit = transformExprSelect_limit(node)
            val new_offset = transformExprSelect_offset(node)
            val new_metas = transformExprSelect_metas(node)
            return if (
                node.setq !== new_setq ||
                node.project !== new_project ||
                node.from !== new_from ||
                node.fromLet !== new_fromLet ||
                node.where !== new_where ||
                node.group !== new_group ||
                node.having !== new_having ||
                node.order !== new_order ||
                node.limit !== new_limit ||
                node.offset !== new_offset ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Expr.Select(
                    setq = new_setq,
                    project = new_project,
                    from = new_from,
                    fromLet = new_fromLet,
                    where = new_where,
                    group = new_group,
                    having = new_having,
                    order = new_order,
                    limit = new_limit,
                    offset = new_offset,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprSelect_setq(node: PartiqlAst.Expr.Select) =
            node.setq?.let { transformSetQuantifier(it) }
        open fun transformExprSelect_project(node: PartiqlAst.Expr.Select) =
            transformProjection(node.project)
        open fun transformExprSelect_from(node: PartiqlAst.Expr.Select) =
            transformFromSource(node.from)
        open fun transformExprSelect_fromLet(node: PartiqlAst.Expr.Select) =
            node.fromLet?.let { transformLet(it) }
        open fun transformExprSelect_where(node: PartiqlAst.Expr.Select) =
            node.where?.let { transformExpr(it) }
        open fun transformExprSelect_group(node: PartiqlAst.Expr.Select) =
            node.group?.let { transformGroupBy(it) }
        open fun transformExprSelect_having(node: PartiqlAst.Expr.Select) =
            node.having?.let { transformExpr(it) }
        open fun transformExprSelect_order(node: PartiqlAst.Expr.Select) =
            node.order?.let { transformOrderBy(it) }
        open fun transformExprSelect_limit(node: PartiqlAst.Expr.Select) =
            node.limit?.let { transformExpr(it) }
        open fun transformExprSelect_offset(node: PartiqlAst.Expr.Select) =
            node.offset?.let { transformExpr(it) }
        open fun transformExprSelect_metas(node: PartiqlAst.Expr.Select) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: PathStep
        //////////////////////////////////////
        open fun transformPathStep(node: PartiqlAst.PathStep): PartiqlAst.PathStep =
            when(node) {
                is PartiqlAst.PathStep.PathExpr -> transformPathStepPathExpr(node)
                is PartiqlAst.PathStep.PathWildcard -> transformPathStepPathWildcard(node)
                is PartiqlAst.PathStep.PathUnpivot -> transformPathStepPathUnpivot(node)
            }
        // Variant PathStepPathExpr
        open fun transformPathStepPathExpr(node: PartiqlAst.PathStep.PathExpr): PartiqlAst.PathStep {
            val new_index = transformPathStepPathExpr_index(node)
            val new_case = transformPathStepPathExpr_case(node)
            val new_metas = transformPathStepPathExpr_metas(node)
            return if (
                node.index !== new_index ||
                node.case !== new_case ||
                node.metas !== new_metas
            ) {
                PartiqlAst.PathStep.PathExpr(
                    index = new_index,
                    case = new_case,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformPathStepPathExpr_index(node: PartiqlAst.PathStep.PathExpr) =
            transformExpr(node.index)
        open fun transformPathStepPathExpr_case(node: PartiqlAst.PathStep.PathExpr) =
            transformCaseSensitivity(node.case)
        open fun transformPathStepPathExpr_metas(node: PartiqlAst.PathStep.PathExpr) =
            transformMetas(node.metas)
    
        // Variant PathStepPathWildcard
        open fun transformPathStepPathWildcard(node: PartiqlAst.PathStep.PathWildcard): PartiqlAst.PathStep {
            val new_metas = transformPathStepPathWildcard_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.PathStep.PathWildcard(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformPathStepPathWildcard_metas(node: PartiqlAst.PathStep.PathWildcard) =
            transformMetas(node.metas)
    
        // Variant PathStepPathUnpivot
        open fun transformPathStepPathUnpivot(node: PartiqlAst.PathStep.PathUnpivot): PartiqlAst.PathStep {
            val new_metas = transformPathStepPathUnpivot_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.PathStep.PathUnpivot(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformPathStepPathUnpivot_metas(node: PartiqlAst.PathStep.PathUnpivot) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: Projection
        //////////////////////////////////////
        open fun transformProjection(node: PartiqlAst.Projection): PartiqlAst.Projection =
            when(node) {
                is PartiqlAst.Projection.ProjectStar -> transformProjectionProjectStar(node)
                is PartiqlAst.Projection.ProjectList -> transformProjectionProjectList(node)
                is PartiqlAst.Projection.ProjectPivot -> transformProjectionProjectPivot(node)
                is PartiqlAst.Projection.ProjectValue -> transformProjectionProjectValue(node)
            }
        // Variant ProjectionProjectStar
        open fun transformProjectionProjectStar(node: PartiqlAst.Projection.ProjectStar): PartiqlAst.Projection {
            val new_metas = transformProjectionProjectStar_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Projection.ProjectStar(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformProjectionProjectStar_metas(node: PartiqlAst.Projection.ProjectStar) =
            transformMetas(node.metas)
    
        // Variant ProjectionProjectList
        open fun transformProjectionProjectList(node: PartiqlAst.Projection.ProjectList): PartiqlAst.Projection {
            val new_projectItems = transformProjectionProjectList_projectItems(node)
            val new_metas = transformProjectionProjectList_metas(node)
            return if (
                node.projectItems !== new_projectItems ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Projection.ProjectList(
                    projectItems = new_projectItems,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformProjectionProjectList_projectItems(node: PartiqlAst.Projection.ProjectList) =
            node.projectItems.map { transformProjectItem(it) }
        open fun transformProjectionProjectList_metas(node: PartiqlAst.Projection.ProjectList) =
            transformMetas(node.metas)
    
        // Variant ProjectionProjectPivot
        open fun transformProjectionProjectPivot(node: PartiqlAst.Projection.ProjectPivot): PartiqlAst.Projection {
            val new_value = transformProjectionProjectPivot_value(node)
            val new_key = transformProjectionProjectPivot_key(node)
            val new_metas = transformProjectionProjectPivot_metas(node)
            return if (
                node.value !== new_value ||
                node.key !== new_key ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Projection.ProjectPivot(
                    value = new_value,
                    key = new_key,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformProjectionProjectPivot_value(node: PartiqlAst.Projection.ProjectPivot) =
            transformExpr(node.value)
        open fun transformProjectionProjectPivot_key(node: PartiqlAst.Projection.ProjectPivot) =
            transformExpr(node.key)
        open fun transformProjectionProjectPivot_metas(node: PartiqlAst.Projection.ProjectPivot) =
            transformMetas(node.metas)
    
        // Variant ProjectionProjectValue
        open fun transformProjectionProjectValue(node: PartiqlAst.Projection.ProjectValue): PartiqlAst.Projection {
            val new_value = transformProjectionProjectValue_value(node)
            val new_metas = transformProjectionProjectValue_metas(node)
            return if (
                node.value !== new_value ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Projection.ProjectValue(
                    value = new_value,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformProjectionProjectValue_value(node: PartiqlAst.Projection.ProjectValue) =
            transformExpr(node.value)
        open fun transformProjectionProjectValue_metas(node: PartiqlAst.Projection.ProjectValue) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: ProjectItem
        //////////////////////////////////////
        open fun transformProjectItem(node: PartiqlAst.ProjectItem): PartiqlAst.ProjectItem =
            when(node) {
                is PartiqlAst.ProjectItem.ProjectAll -> transformProjectItemProjectAll(node)
                is PartiqlAst.ProjectItem.ProjectExpr -> transformProjectItemProjectExpr(node)
            }
        // Variant ProjectItemProjectAll
        open fun transformProjectItemProjectAll(node: PartiqlAst.ProjectItem.ProjectAll): PartiqlAst.ProjectItem {
            val new_expr = transformProjectItemProjectAll_expr(node)
            val new_metas = transformProjectItemProjectAll_metas(node)
            return if (
                node.expr !== new_expr ||
                node.metas !== new_metas
            ) {
                PartiqlAst.ProjectItem.ProjectAll(
                    expr = new_expr,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformProjectItemProjectAll_expr(node: PartiqlAst.ProjectItem.ProjectAll) =
            transformExpr(node.expr)
        open fun transformProjectItemProjectAll_metas(node: PartiqlAst.ProjectItem.ProjectAll) =
            transformMetas(node.metas)
    
        // Variant ProjectItemProjectExpr
        open fun transformProjectItemProjectExpr(node: PartiqlAst.ProjectItem.ProjectExpr): PartiqlAst.ProjectItem {
            val new_expr = transformProjectItemProjectExpr_expr(node)
            val new_asAlias = transformProjectItemProjectExpr_asAlias(node)
            val new_metas = transformProjectItemProjectExpr_metas(node)
            return if (
                node.expr !== new_expr ||
                node.asAlias !== new_asAlias ||
                node.metas !== new_metas
            ) {
                PartiqlAst.ProjectItem.ProjectExpr(
                    expr = new_expr,
                    asAlias = new_asAlias,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformProjectItemProjectExpr_expr(node: PartiqlAst.ProjectItem.ProjectExpr) =
            transformExpr(node.expr)
        open fun transformProjectItemProjectExpr_asAlias(node: PartiqlAst.ProjectItem.ProjectExpr) =
            node.asAlias?.let { transformSymbolPrimitive(it) }
        open fun transformProjectItemProjectExpr_metas(node: PartiqlAst.ProjectItem.ProjectExpr) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: FromSource
        //////////////////////////////////////
        open fun transformFromSource(node: PartiqlAst.FromSource): PartiqlAst.FromSource =
            when(node) {
                is PartiqlAst.FromSource.Scan -> transformFromSourceScan(node)
                is PartiqlAst.FromSource.Unpivot -> transformFromSourceUnpivot(node)
                is PartiqlAst.FromSource.Join -> transformFromSourceJoin(node)
            }
        // Variant FromSourceScan
        open fun transformFromSourceScan(node: PartiqlAst.FromSource.Scan): PartiqlAst.FromSource {
            val new_expr = transformFromSourceScan_expr(node)
            val new_asAlias = transformFromSourceScan_asAlias(node)
            val new_atAlias = transformFromSourceScan_atAlias(node)
            val new_byAlias = transformFromSourceScan_byAlias(node)
            val new_metas = transformFromSourceScan_metas(node)
            return if (
                node.expr !== new_expr ||
                node.asAlias !== new_asAlias ||
                node.atAlias !== new_atAlias ||
                node.byAlias !== new_byAlias ||
                node.metas !== new_metas
            ) {
                PartiqlAst.FromSource.Scan(
                    expr = new_expr,
                    asAlias = new_asAlias,
                    atAlias = new_atAlias,
                    byAlias = new_byAlias,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformFromSourceScan_expr(node: PartiqlAst.FromSource.Scan) =
            transformExpr(node.expr)
        open fun transformFromSourceScan_asAlias(node: PartiqlAst.FromSource.Scan) =
            node.asAlias?.let { transformSymbolPrimitive(it) }
        open fun transformFromSourceScan_atAlias(node: PartiqlAst.FromSource.Scan) =
            node.atAlias?.let { transformSymbolPrimitive(it) }
        open fun transformFromSourceScan_byAlias(node: PartiqlAst.FromSource.Scan) =
            node.byAlias?.let { transformSymbolPrimitive(it) }
        open fun transformFromSourceScan_metas(node: PartiqlAst.FromSource.Scan) =
            transformMetas(node.metas)
    
        // Variant FromSourceUnpivot
        open fun transformFromSourceUnpivot(node: PartiqlAst.FromSource.Unpivot): PartiqlAst.FromSource {
            val new_expr = transformFromSourceUnpivot_expr(node)
            val new_asAlias = transformFromSourceUnpivot_asAlias(node)
            val new_atAlias = transformFromSourceUnpivot_atAlias(node)
            val new_byAlias = transformFromSourceUnpivot_byAlias(node)
            val new_metas = transformFromSourceUnpivot_metas(node)
            return if (
                node.expr !== new_expr ||
                node.asAlias !== new_asAlias ||
                node.atAlias !== new_atAlias ||
                node.byAlias !== new_byAlias ||
                node.metas !== new_metas
            ) {
                PartiqlAst.FromSource.Unpivot(
                    expr = new_expr,
                    asAlias = new_asAlias,
                    atAlias = new_atAlias,
                    byAlias = new_byAlias,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformFromSourceUnpivot_expr(node: PartiqlAst.FromSource.Unpivot) =
            transformExpr(node.expr)
        open fun transformFromSourceUnpivot_asAlias(node: PartiqlAst.FromSource.Unpivot) =
            node.asAlias?.let { transformSymbolPrimitive(it) }
        open fun transformFromSourceUnpivot_atAlias(node: PartiqlAst.FromSource.Unpivot) =
            node.atAlias?.let { transformSymbolPrimitive(it) }
        open fun transformFromSourceUnpivot_byAlias(node: PartiqlAst.FromSource.Unpivot) =
            node.byAlias?.let { transformSymbolPrimitive(it) }
        open fun transformFromSourceUnpivot_metas(node: PartiqlAst.FromSource.Unpivot) =
            transformMetas(node.metas)
    
        // Variant FromSourceJoin
        open fun transformFromSourceJoin(node: PartiqlAst.FromSource.Join): PartiqlAst.FromSource {
            val new_type = transformFromSourceJoin_type(node)
            val new_left = transformFromSourceJoin_left(node)
            val new_right = transformFromSourceJoin_right(node)
            val new_predicate = transformFromSourceJoin_predicate(node)
            val new_metas = transformFromSourceJoin_metas(node)
            return if (
                node.type !== new_type ||
                node.left !== new_left ||
                node.right !== new_right ||
                node.predicate !== new_predicate ||
                node.metas !== new_metas
            ) {
                PartiqlAst.FromSource.Join(
                    type = new_type,
                    left = new_left,
                    right = new_right,
                    predicate = new_predicate,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformFromSourceJoin_type(node: PartiqlAst.FromSource.Join) =
            transformJoinType(node.type)
        open fun transformFromSourceJoin_left(node: PartiqlAst.FromSource.Join) =
            transformFromSource(node.left)
        open fun transformFromSourceJoin_right(node: PartiqlAst.FromSource.Join) =
            transformFromSource(node.right)
        open fun transformFromSourceJoin_predicate(node: PartiqlAst.FromSource.Join) =
            node.predicate?.let { transformExpr(it) }
        open fun transformFromSourceJoin_metas(node: PartiqlAst.FromSource.Join) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: JoinType
        //////////////////////////////////////
        open fun transformJoinType(node: PartiqlAst.JoinType): PartiqlAst.JoinType =
            when(node) {
                is PartiqlAst.JoinType.Inner -> transformJoinTypeInner(node)
                is PartiqlAst.JoinType.Left -> transformJoinTypeLeft(node)
                is PartiqlAst.JoinType.Right -> transformJoinTypeRight(node)
                is PartiqlAst.JoinType.Full -> transformJoinTypeFull(node)
            }
        // Variant JoinTypeInner
        open fun transformJoinTypeInner(node: PartiqlAst.JoinType.Inner): PartiqlAst.JoinType {
            val new_metas = transformJoinTypeInner_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.JoinType.Inner(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformJoinTypeInner_metas(node: PartiqlAst.JoinType.Inner) =
            transformMetas(node.metas)
    
        // Variant JoinTypeLeft
        open fun transformJoinTypeLeft(node: PartiqlAst.JoinType.Left): PartiqlAst.JoinType {
            val new_metas = transformJoinTypeLeft_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.JoinType.Left(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformJoinTypeLeft_metas(node: PartiqlAst.JoinType.Left) =
            transformMetas(node.metas)
    
        // Variant JoinTypeRight
        open fun transformJoinTypeRight(node: PartiqlAst.JoinType.Right): PartiqlAst.JoinType {
            val new_metas = transformJoinTypeRight_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.JoinType.Right(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformJoinTypeRight_metas(node: PartiqlAst.JoinType.Right) =
            transformMetas(node.metas)
    
        // Variant JoinTypeFull
        open fun transformJoinTypeFull(node: PartiqlAst.JoinType.Full): PartiqlAst.JoinType {
            val new_metas = transformJoinTypeFull_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.JoinType.Full(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformJoinTypeFull_metas(node: PartiqlAst.JoinType.Full) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: GraphMatchDirection
        //////////////////////////////////////
        open fun transformGraphMatchDirection(node: PartiqlAst.GraphMatchDirection): PartiqlAst.GraphMatchDirection =
            when(node) {
                is PartiqlAst.GraphMatchDirection.EdgeLeft -> transformGraphMatchDirectionEdgeLeft(node)
                is PartiqlAst.GraphMatchDirection.EdgeUndirected -> transformGraphMatchDirectionEdgeUndirected(node)
                is PartiqlAst.GraphMatchDirection.EdgeRight -> transformGraphMatchDirectionEdgeRight(node)
                is PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected -> transformGraphMatchDirectionEdgeLeftOrUndirected(node)
                is PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight -> transformGraphMatchDirectionEdgeUndirectedOrRight(node)
                is PartiqlAst.GraphMatchDirection.EdgeLeftOrRight -> transformGraphMatchDirectionEdgeLeftOrRight(node)
                is PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight -> transformGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node)
            }
        // Variant GraphMatchDirectionEdgeLeft
        open fun transformGraphMatchDirectionEdgeLeft(node: PartiqlAst.GraphMatchDirection.EdgeLeft): PartiqlAst.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeLeft_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchDirection.EdgeLeft(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeLeft_metas(node: PartiqlAst.GraphMatchDirection.EdgeLeft) =
            transformMetas(node.metas)
    
        // Variant GraphMatchDirectionEdgeUndirected
        open fun transformGraphMatchDirectionEdgeUndirected(node: PartiqlAst.GraphMatchDirection.EdgeUndirected): PartiqlAst.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeUndirected_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchDirection.EdgeUndirected(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeUndirected_metas(node: PartiqlAst.GraphMatchDirection.EdgeUndirected) =
            transformMetas(node.metas)
    
        // Variant GraphMatchDirectionEdgeRight
        open fun transformGraphMatchDirectionEdgeRight(node: PartiqlAst.GraphMatchDirection.EdgeRight): PartiqlAst.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeRight_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchDirection.EdgeRight(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeRight_metas(node: PartiqlAst.GraphMatchDirection.EdgeRight) =
            transformMetas(node.metas)
    
        // Variant GraphMatchDirectionEdgeLeftOrUndirected
        open fun transformGraphMatchDirectionEdgeLeftOrUndirected(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected): PartiqlAst.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeLeftOrUndirected_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeLeftOrUndirected_metas(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirected) =
            transformMetas(node.metas)
    
        // Variant GraphMatchDirectionEdgeUndirectedOrRight
        open fun transformGraphMatchDirectionEdgeUndirectedOrRight(node: PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight): PartiqlAst.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeUndirectedOrRight_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeUndirectedOrRight_metas(node: PartiqlAst.GraphMatchDirection.EdgeUndirectedOrRight) =
            transformMetas(node.metas)
    
        // Variant GraphMatchDirectionEdgeLeftOrRight
        open fun transformGraphMatchDirectionEdgeLeftOrRight(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrRight): PartiqlAst.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeLeftOrRight_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchDirection.EdgeLeftOrRight(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeLeftOrRight_metas(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrRight) =
            transformMetas(node.metas)
    
        // Variant GraphMatchDirectionEdgeLeftOrUndirectedOrRight
        open fun transformGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight): PartiqlAst.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeLeftOrUndirectedOrRight_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeLeftOrUndirectedOrRight_metas(node: PartiqlAst.GraphMatchDirection.EdgeLeftOrUndirectedOrRight) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: GraphMatchPatternPart
        //////////////////////////////////////
        open fun transformGraphMatchPatternPart(node: PartiqlAst.GraphMatchPatternPart): PartiqlAst.GraphMatchPatternPart =
            when(node) {
                is PartiqlAst.GraphMatchPatternPart.Node -> transformGraphMatchPatternPartNode(node)
                is PartiqlAst.GraphMatchPatternPart.Edge -> transformGraphMatchPatternPartEdge(node)
                is PartiqlAst.GraphMatchPatternPart.Pattern -> transformGraphMatchPatternPartPattern(node)
            }
        // Variant GraphMatchPatternPartNode
        open fun transformGraphMatchPatternPartNode(node: PartiqlAst.GraphMatchPatternPart.Node): PartiqlAst.GraphMatchPatternPart {
            val new_prefilter = transformGraphMatchPatternPartNode_prefilter(node)
            val new_variable = transformGraphMatchPatternPartNode_variable(node)
            val new_label = transformGraphMatchPatternPartNode_label(node)
            val new_metas = transformGraphMatchPatternPartNode_metas(node)
            return if (
                node.prefilter !== new_prefilter ||
                node.variable !== new_variable ||
                node.label !== new_label ||
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchPatternPart.Node(
                    prefilter = new_prefilter,
                    variable = new_variable,
                    label = new_label,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchPatternPartNode_prefilter(node: PartiqlAst.GraphMatchPatternPart.Node) =
            node.prefilter?.let { transformExpr(it) }
        open fun transformGraphMatchPatternPartNode_variable(node: PartiqlAst.GraphMatchPatternPart.Node) =
            node.variable?.let { transformSymbolPrimitive(it) }
        open fun transformGraphMatchPatternPartNode_label(node: PartiqlAst.GraphMatchPatternPart.Node) =
            node.label.map { transformSymbolPrimitive(it) }
        open fun transformGraphMatchPatternPartNode_metas(node: PartiqlAst.GraphMatchPatternPart.Node) =
            transformMetas(node.metas)
    
        // Variant GraphMatchPatternPartEdge
        open fun transformGraphMatchPatternPartEdge(node: PartiqlAst.GraphMatchPatternPart.Edge): PartiqlAst.GraphMatchPatternPart {
            val new_direction = transformGraphMatchPatternPartEdge_direction(node)
            val new_quantifier = transformGraphMatchPatternPartEdge_quantifier(node)
            val new_prefilter = transformGraphMatchPatternPartEdge_prefilter(node)
            val new_variable = transformGraphMatchPatternPartEdge_variable(node)
            val new_label = transformGraphMatchPatternPartEdge_label(node)
            val new_metas = transformGraphMatchPatternPartEdge_metas(node)
            return if (
                node.direction !== new_direction ||
                node.quantifier !== new_quantifier ||
                node.prefilter !== new_prefilter ||
                node.variable !== new_variable ||
                node.label !== new_label ||
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchPatternPart.Edge(
                    direction = new_direction,
                    quantifier = new_quantifier,
                    prefilter = new_prefilter,
                    variable = new_variable,
                    label = new_label,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchPatternPartEdge_direction(node: PartiqlAst.GraphMatchPatternPart.Edge) =
            transformGraphMatchDirection(node.direction)
        open fun transformGraphMatchPatternPartEdge_quantifier(node: PartiqlAst.GraphMatchPatternPart.Edge) =
            node.quantifier?.let { transformGraphMatchQuantifier(it) }
        open fun transformGraphMatchPatternPartEdge_prefilter(node: PartiqlAst.GraphMatchPatternPart.Edge) =
            node.prefilter?.let { transformExpr(it) }
        open fun transformGraphMatchPatternPartEdge_variable(node: PartiqlAst.GraphMatchPatternPart.Edge) =
            node.variable?.let { transformSymbolPrimitive(it) }
        open fun transformGraphMatchPatternPartEdge_label(node: PartiqlAst.GraphMatchPatternPart.Edge) =
            node.label.map { transformSymbolPrimitive(it) }
        open fun transformGraphMatchPatternPartEdge_metas(node: PartiqlAst.GraphMatchPatternPart.Edge) =
            transformMetas(node.metas)
    
        // Variant GraphMatchPatternPartPattern
        open fun transformGraphMatchPatternPartPattern(node: PartiqlAst.GraphMatchPatternPart.Pattern): PartiqlAst.GraphMatchPatternPart {
            val new_pattern = transformGraphMatchPatternPartPattern_pattern(node)
            val new_metas = transformGraphMatchPatternPartPattern_metas(node)
            return if (
                node.pattern !== new_pattern ||
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchPatternPart.Pattern(
                    pattern = new_pattern,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchPatternPartPattern_pattern(node: PartiqlAst.GraphMatchPatternPart.Pattern) =
            transformGraphMatchPattern(node.pattern)
        open fun transformGraphMatchPatternPartPattern_metas(node: PartiqlAst.GraphMatchPatternPart.Pattern) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: GraphMatchRestrictor
        //////////////////////////////////////
        open fun transformGraphMatchRestrictor(node: PartiqlAst.GraphMatchRestrictor): PartiqlAst.GraphMatchRestrictor =
            when(node) {
                is PartiqlAst.GraphMatchRestrictor.RestrictorTrail -> transformGraphMatchRestrictorRestrictorTrail(node)
                is PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic -> transformGraphMatchRestrictorRestrictorAcyclic(node)
                is PartiqlAst.GraphMatchRestrictor.RestrictorSimple -> transformGraphMatchRestrictorRestrictorSimple(node)
            }
        // Variant GraphMatchRestrictorRestrictorTrail
        open fun transformGraphMatchRestrictorRestrictorTrail(node: PartiqlAst.GraphMatchRestrictor.RestrictorTrail): PartiqlAst.GraphMatchRestrictor {
            val new_metas = transformGraphMatchRestrictorRestrictorTrail_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchRestrictor.RestrictorTrail(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchRestrictorRestrictorTrail_metas(node: PartiqlAst.GraphMatchRestrictor.RestrictorTrail) =
            transformMetas(node.metas)
    
        // Variant GraphMatchRestrictorRestrictorAcyclic
        open fun transformGraphMatchRestrictorRestrictorAcyclic(node: PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic): PartiqlAst.GraphMatchRestrictor {
            val new_metas = transformGraphMatchRestrictorRestrictorAcyclic_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchRestrictorRestrictorAcyclic_metas(node: PartiqlAst.GraphMatchRestrictor.RestrictorAcyclic) =
            transformMetas(node.metas)
    
        // Variant GraphMatchRestrictorRestrictorSimple
        open fun transformGraphMatchRestrictorRestrictorSimple(node: PartiqlAst.GraphMatchRestrictor.RestrictorSimple): PartiqlAst.GraphMatchRestrictor {
            val new_metas = transformGraphMatchRestrictorRestrictorSimple_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchRestrictor.RestrictorSimple(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchRestrictorRestrictorSimple_metas(node: PartiqlAst.GraphMatchRestrictor.RestrictorSimple) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: GraphMatchSelector
        //////////////////////////////////////
        open fun transformGraphMatchSelector(node: PartiqlAst.GraphMatchSelector): PartiqlAst.GraphMatchSelector =
            when(node) {
                is PartiqlAst.GraphMatchSelector.SelectorAnyShortest -> transformGraphMatchSelectorSelectorAnyShortest(node)
                is PartiqlAst.GraphMatchSelector.SelectorAllShortest -> transformGraphMatchSelectorSelectorAllShortest(node)
                is PartiqlAst.GraphMatchSelector.SelectorAny -> transformGraphMatchSelectorSelectorAny(node)
                is PartiqlAst.GraphMatchSelector.SelectorAnyK -> transformGraphMatchSelectorSelectorAnyK(node)
                is PartiqlAst.GraphMatchSelector.SelectorShortestK -> transformGraphMatchSelectorSelectorShortestK(node)
                is PartiqlAst.GraphMatchSelector.SelectorShortestKGroup -> transformGraphMatchSelectorSelectorShortestKGroup(node)
            }
        // Variant GraphMatchSelectorSelectorAnyShortest
        open fun transformGraphMatchSelectorSelectorAnyShortest(node: PartiqlAst.GraphMatchSelector.SelectorAnyShortest): PartiqlAst.GraphMatchSelector {
            val new_metas = transformGraphMatchSelectorSelectorAnyShortest_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchSelector.SelectorAnyShortest(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchSelectorSelectorAnyShortest_metas(node: PartiqlAst.GraphMatchSelector.SelectorAnyShortest) =
            transformMetas(node.metas)
    
        // Variant GraphMatchSelectorSelectorAllShortest
        open fun transformGraphMatchSelectorSelectorAllShortest(node: PartiqlAst.GraphMatchSelector.SelectorAllShortest): PartiqlAst.GraphMatchSelector {
            val new_metas = transformGraphMatchSelectorSelectorAllShortest_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchSelector.SelectorAllShortest(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchSelectorSelectorAllShortest_metas(node: PartiqlAst.GraphMatchSelector.SelectorAllShortest) =
            transformMetas(node.metas)
    
        // Variant GraphMatchSelectorSelectorAny
        open fun transformGraphMatchSelectorSelectorAny(node: PartiqlAst.GraphMatchSelector.SelectorAny): PartiqlAst.GraphMatchSelector {
            val new_metas = transformGraphMatchSelectorSelectorAny_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchSelector.SelectorAny(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchSelectorSelectorAny_metas(node: PartiqlAst.GraphMatchSelector.SelectorAny) =
            transformMetas(node.metas)
    
        // Variant GraphMatchSelectorSelectorAnyK
        open fun transformGraphMatchSelectorSelectorAnyK(node: PartiqlAst.GraphMatchSelector.SelectorAnyK): PartiqlAst.GraphMatchSelector {
            val new_k = transformGraphMatchSelectorSelectorAnyK_k(node)
            val new_metas = transformGraphMatchSelectorSelectorAnyK_metas(node)
            return if (
                node.k !== new_k ||
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchSelector.SelectorAnyK(
                    k = new_k,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchSelectorSelectorAnyK_k(node: PartiqlAst.GraphMatchSelector.SelectorAnyK) =
            transformLongPrimitive(node.k)
        open fun transformGraphMatchSelectorSelectorAnyK_metas(node: PartiqlAst.GraphMatchSelector.SelectorAnyK) =
            transformMetas(node.metas)
    
        // Variant GraphMatchSelectorSelectorShortestK
        open fun transformGraphMatchSelectorSelectorShortestK(node: PartiqlAst.GraphMatchSelector.SelectorShortestK): PartiqlAst.GraphMatchSelector {
            val new_k = transformGraphMatchSelectorSelectorShortestK_k(node)
            val new_metas = transformGraphMatchSelectorSelectorShortestK_metas(node)
            return if (
                node.k !== new_k ||
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchSelector.SelectorShortestK(
                    k = new_k,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchSelectorSelectorShortestK_k(node: PartiqlAst.GraphMatchSelector.SelectorShortestK) =
            transformLongPrimitive(node.k)
        open fun transformGraphMatchSelectorSelectorShortestK_metas(node: PartiqlAst.GraphMatchSelector.SelectorShortestK) =
            transformMetas(node.metas)
    
        // Variant GraphMatchSelectorSelectorShortestKGroup
        open fun transformGraphMatchSelectorSelectorShortestKGroup(node: PartiqlAst.GraphMatchSelector.SelectorShortestKGroup): PartiqlAst.GraphMatchSelector {
            val new_k = transformGraphMatchSelectorSelectorShortestKGroup_k(node)
            val new_metas = transformGraphMatchSelectorSelectorShortestKGroup_metas(node)
            return if (
                node.k !== new_k ||
                node.metas !== new_metas
            ) {
                PartiqlAst.GraphMatchSelector.SelectorShortestKGroup(
                    k = new_k,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchSelectorSelectorShortestKGroup_k(node: PartiqlAst.GraphMatchSelector.SelectorShortestKGroup) =
            transformLongPrimitive(node.k)
        open fun transformGraphMatchSelectorSelectorShortestKGroup_metas(node: PartiqlAst.GraphMatchSelector.SelectorShortestKGroup) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: GroupingStrategy
        //////////////////////////////////////
        open fun transformGroupingStrategy(node: PartiqlAst.GroupingStrategy): PartiqlAst.GroupingStrategy =
            when(node) {
                is PartiqlAst.GroupingStrategy.GroupFull -> transformGroupingStrategyGroupFull(node)
                is PartiqlAst.GroupingStrategy.GroupPartial -> transformGroupingStrategyGroupPartial(node)
            }
        // Variant GroupingStrategyGroupFull
        open fun transformGroupingStrategyGroupFull(node: PartiqlAst.GroupingStrategy.GroupFull): PartiqlAst.GroupingStrategy {
            val new_metas = transformGroupingStrategyGroupFull_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GroupingStrategy.GroupFull(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGroupingStrategyGroupFull_metas(node: PartiqlAst.GroupingStrategy.GroupFull) =
            transformMetas(node.metas)
    
        // Variant GroupingStrategyGroupPartial
        open fun transformGroupingStrategyGroupPartial(node: PartiqlAst.GroupingStrategy.GroupPartial): PartiqlAst.GroupingStrategy {
            val new_metas = transformGroupingStrategyGroupPartial_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.GroupingStrategy.GroupPartial(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGroupingStrategyGroupPartial_metas(node: PartiqlAst.GroupingStrategy.GroupPartial) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: OrderingSpec
        //////////////////////////////////////
        open fun transformOrderingSpec(node: PartiqlAst.OrderingSpec): PartiqlAst.OrderingSpec =
            when(node) {
                is PartiqlAst.OrderingSpec.Asc -> transformOrderingSpecAsc(node)
                is PartiqlAst.OrderingSpec.Desc -> transformOrderingSpecDesc(node)
            }
        // Variant OrderingSpecAsc
        open fun transformOrderingSpecAsc(node: PartiqlAst.OrderingSpec.Asc): PartiqlAst.OrderingSpec {
            val new_metas = transformOrderingSpecAsc_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.OrderingSpec.Asc(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformOrderingSpecAsc_metas(node: PartiqlAst.OrderingSpec.Asc) =
            transformMetas(node.metas)
    
        // Variant OrderingSpecDesc
        open fun transformOrderingSpecDesc(node: PartiqlAst.OrderingSpec.Desc): PartiqlAst.OrderingSpec {
            val new_metas = transformOrderingSpecDesc_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.OrderingSpec.Desc(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformOrderingSpecDesc_metas(node: PartiqlAst.OrderingSpec.Desc) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: NullsSpec
        //////////////////////////////////////
        open fun transformNullsSpec(node: PartiqlAst.NullsSpec): PartiqlAst.NullsSpec =
            when(node) {
                is PartiqlAst.NullsSpec.NullsFirst -> transformNullsSpecNullsFirst(node)
                is PartiqlAst.NullsSpec.NullsLast -> transformNullsSpecNullsLast(node)
            }
        // Variant NullsSpecNullsFirst
        open fun transformNullsSpecNullsFirst(node: PartiqlAst.NullsSpec.NullsFirst): PartiqlAst.NullsSpec {
            val new_metas = transformNullsSpecNullsFirst_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.NullsSpec.NullsFirst(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformNullsSpecNullsFirst_metas(node: PartiqlAst.NullsSpec.NullsFirst) =
            transformMetas(node.metas)
    
        // Variant NullsSpecNullsLast
        open fun transformNullsSpecNullsLast(node: PartiqlAst.NullsSpec.NullsLast): PartiqlAst.NullsSpec {
            val new_metas = transformNullsSpecNullsLast_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.NullsSpec.NullsLast(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformNullsSpecNullsLast_metas(node: PartiqlAst.NullsSpec.NullsLast) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: CaseSensitivity
        //////////////////////////////////////
        open fun transformCaseSensitivity(node: PartiqlAst.CaseSensitivity): PartiqlAst.CaseSensitivity =
            when(node) {
                is PartiqlAst.CaseSensitivity.CaseSensitive -> transformCaseSensitivityCaseSensitive(node)
                is PartiqlAst.CaseSensitivity.CaseInsensitive -> transformCaseSensitivityCaseInsensitive(node)
            }
        // Variant CaseSensitivityCaseSensitive
        open fun transformCaseSensitivityCaseSensitive(node: PartiqlAst.CaseSensitivity.CaseSensitive): PartiqlAst.CaseSensitivity {
            val new_metas = transformCaseSensitivityCaseSensitive_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.CaseSensitivity.CaseSensitive(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformCaseSensitivityCaseSensitive_metas(node: PartiqlAst.CaseSensitivity.CaseSensitive) =
            transformMetas(node.metas)
    
        // Variant CaseSensitivityCaseInsensitive
        open fun transformCaseSensitivityCaseInsensitive(node: PartiqlAst.CaseSensitivity.CaseInsensitive): PartiqlAst.CaseSensitivity {
            val new_metas = transformCaseSensitivityCaseInsensitive_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.CaseSensitivity.CaseInsensitive(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformCaseSensitivityCaseInsensitive_metas(node: PartiqlAst.CaseSensitivity.CaseInsensitive) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: ScopeQualifier
        //////////////////////////////////////
        open fun transformScopeQualifier(node: PartiqlAst.ScopeQualifier): PartiqlAst.ScopeQualifier =
            when(node) {
                is PartiqlAst.ScopeQualifier.Unqualified -> transformScopeQualifierUnqualified(node)
                is PartiqlAst.ScopeQualifier.LocalsFirst -> transformScopeQualifierLocalsFirst(node)
            }
        // Variant ScopeQualifierUnqualified
        open fun transformScopeQualifierUnqualified(node: PartiqlAst.ScopeQualifier.Unqualified): PartiqlAst.ScopeQualifier {
            val new_metas = transformScopeQualifierUnqualified_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.ScopeQualifier.Unqualified(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformScopeQualifierUnqualified_metas(node: PartiqlAst.ScopeQualifier.Unqualified) =
            transformMetas(node.metas)
    
        // Variant ScopeQualifierLocalsFirst
        open fun transformScopeQualifierLocalsFirst(node: PartiqlAst.ScopeQualifier.LocalsFirst): PartiqlAst.ScopeQualifier {
            val new_metas = transformScopeQualifierLocalsFirst_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.ScopeQualifier.LocalsFirst(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformScopeQualifierLocalsFirst_metas(node: PartiqlAst.ScopeQualifier.LocalsFirst) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: SetQuantifier
        //////////////////////////////////////
        open fun transformSetQuantifier(node: PartiqlAst.SetQuantifier): PartiqlAst.SetQuantifier =
            when(node) {
                is PartiqlAst.SetQuantifier.All -> transformSetQuantifierAll(node)
                is PartiqlAst.SetQuantifier.Distinct -> transformSetQuantifierDistinct(node)
            }
        // Variant SetQuantifierAll
        open fun transformSetQuantifierAll(node: PartiqlAst.SetQuantifier.All): PartiqlAst.SetQuantifier {
            val new_metas = transformSetQuantifierAll_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.SetQuantifier.All(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformSetQuantifierAll_metas(node: PartiqlAst.SetQuantifier.All) =
            transformMetas(node.metas)
    
        // Variant SetQuantifierDistinct
        open fun transformSetQuantifierDistinct(node: PartiqlAst.SetQuantifier.Distinct): PartiqlAst.SetQuantifier {
            val new_metas = transformSetQuantifierDistinct_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.SetQuantifier.Distinct(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformSetQuantifierDistinct_metas(node: PartiqlAst.SetQuantifier.Distinct) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: BagOpType
        //////////////////////////////////////
        open fun transformBagOpType(node: PartiqlAst.BagOpType): PartiqlAst.BagOpType =
            when(node) {
                is PartiqlAst.BagOpType.Union -> transformBagOpTypeUnion(node)
                is PartiqlAst.BagOpType.Intersect -> transformBagOpTypeIntersect(node)
                is PartiqlAst.BagOpType.Except -> transformBagOpTypeExcept(node)
                is PartiqlAst.BagOpType.OuterUnion -> transformBagOpTypeOuterUnion(node)
                is PartiqlAst.BagOpType.OuterIntersect -> transformBagOpTypeOuterIntersect(node)
                is PartiqlAst.BagOpType.OuterExcept -> transformBagOpTypeOuterExcept(node)
            }
        // Variant BagOpTypeUnion
        open fun transformBagOpTypeUnion(node: PartiqlAst.BagOpType.Union): PartiqlAst.BagOpType {
            val new_metas = transformBagOpTypeUnion_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.BagOpType.Union(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBagOpTypeUnion_metas(node: PartiqlAst.BagOpType.Union) =
            transformMetas(node.metas)
    
        // Variant BagOpTypeIntersect
        open fun transformBagOpTypeIntersect(node: PartiqlAst.BagOpType.Intersect): PartiqlAst.BagOpType {
            val new_metas = transformBagOpTypeIntersect_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.BagOpType.Intersect(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBagOpTypeIntersect_metas(node: PartiqlAst.BagOpType.Intersect) =
            transformMetas(node.metas)
    
        // Variant BagOpTypeExcept
        open fun transformBagOpTypeExcept(node: PartiqlAst.BagOpType.Except): PartiqlAst.BagOpType {
            val new_metas = transformBagOpTypeExcept_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.BagOpType.Except(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBagOpTypeExcept_metas(node: PartiqlAst.BagOpType.Except) =
            transformMetas(node.metas)
    
        // Variant BagOpTypeOuterUnion
        open fun transformBagOpTypeOuterUnion(node: PartiqlAst.BagOpType.OuterUnion): PartiqlAst.BagOpType {
            val new_metas = transformBagOpTypeOuterUnion_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.BagOpType.OuterUnion(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBagOpTypeOuterUnion_metas(node: PartiqlAst.BagOpType.OuterUnion) =
            transformMetas(node.metas)
    
        // Variant BagOpTypeOuterIntersect
        open fun transformBagOpTypeOuterIntersect(node: PartiqlAst.BagOpType.OuterIntersect): PartiqlAst.BagOpType {
            val new_metas = transformBagOpTypeOuterIntersect_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.BagOpType.OuterIntersect(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBagOpTypeOuterIntersect_metas(node: PartiqlAst.BagOpType.OuterIntersect) =
            transformMetas(node.metas)
    
        // Variant BagOpTypeOuterExcept
        open fun transformBagOpTypeOuterExcept(node: PartiqlAst.BagOpType.OuterExcept): PartiqlAst.BagOpType {
            val new_metas = transformBagOpTypeOuterExcept_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.BagOpType.OuterExcept(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBagOpTypeOuterExcept_metas(node: PartiqlAst.BagOpType.OuterExcept) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: DmlOp
        //////////////////////////////////////
        open fun transformDmlOp(node: PartiqlAst.DmlOp): PartiqlAst.DmlOp =
            when(node) {
                is PartiqlAst.DmlOp.Insert -> transformDmlOpInsert(node)
                is PartiqlAst.DmlOp.InsertValue -> transformDmlOpInsertValue(node)
                is PartiqlAst.DmlOp.Set -> transformDmlOpSet(node)
                is PartiqlAst.DmlOp.Remove -> transformDmlOpRemove(node)
                is PartiqlAst.DmlOp.Delete -> transformDmlOpDelete(node)
            }
        // Variant DmlOpInsert
        open fun transformDmlOpInsert(node: PartiqlAst.DmlOp.Insert): PartiqlAst.DmlOp {
            val new_target = transformDmlOpInsert_target(node)
            val new_values = transformDmlOpInsert_values(node)
            val new_conflictAction = transformDmlOpInsert_conflictAction(node)
            val new_metas = transformDmlOpInsert_metas(node)
            return if (
                node.target !== new_target ||
                node.values !== new_values ||
                node.conflictAction !== new_conflictAction ||
                node.metas !== new_metas
            ) {
                PartiqlAst.DmlOp.Insert(
                    target = new_target,
                    values = new_values,
                    conflictAction = new_conflictAction,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformDmlOpInsert_target(node: PartiqlAst.DmlOp.Insert) =
            transformExpr(node.target)
        open fun transformDmlOpInsert_values(node: PartiqlAst.DmlOp.Insert) =
            transformExpr(node.values)
        open fun transformDmlOpInsert_conflictAction(node: PartiqlAst.DmlOp.Insert) =
            node.conflictAction?.let { transformConflictAction(it) }
        open fun transformDmlOpInsert_metas(node: PartiqlAst.DmlOp.Insert) =
            transformMetas(node.metas)
    
        // Variant DmlOpInsertValue
        open fun transformDmlOpInsertValue(node: PartiqlAst.DmlOp.InsertValue): PartiqlAst.DmlOp {
            val new_target = transformDmlOpInsertValue_target(node)
            val new_value = transformDmlOpInsertValue_value(node)
            val new_index = transformDmlOpInsertValue_index(node)
            val new_onConflict = transformDmlOpInsertValue_onConflict(node)
            val new_metas = transformDmlOpInsertValue_metas(node)
            return if (
                node.target !== new_target ||
                node.value !== new_value ||
                node.index !== new_index ||
                node.onConflict !== new_onConflict ||
                node.metas !== new_metas
            ) {
                PartiqlAst.DmlOp.InsertValue(
                    target = new_target,
                    value = new_value,
                    index = new_index,
                    onConflict = new_onConflict,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformDmlOpInsertValue_target(node: PartiqlAst.DmlOp.InsertValue) =
            transformExpr(node.target)
        open fun transformDmlOpInsertValue_value(node: PartiqlAst.DmlOp.InsertValue) =
            transformExpr(node.value)
        open fun transformDmlOpInsertValue_index(node: PartiqlAst.DmlOp.InsertValue) =
            node.index?.let { transformExpr(it) }
        open fun transformDmlOpInsertValue_onConflict(node: PartiqlAst.DmlOp.InsertValue) =
            node.onConflict?.let { transformOnConflict(it) }
        open fun transformDmlOpInsertValue_metas(node: PartiqlAst.DmlOp.InsertValue) =
            transformMetas(node.metas)
    
        // Variant DmlOpSet
        open fun transformDmlOpSet(node: PartiqlAst.DmlOp.Set): PartiqlAst.DmlOp {
            val new_assignment = transformDmlOpSet_assignment(node)
            val new_metas = transformDmlOpSet_metas(node)
            return if (
                node.assignment !== new_assignment ||
                node.metas !== new_metas
            ) {
                PartiqlAst.DmlOp.Set(
                    assignment = new_assignment,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformDmlOpSet_assignment(node: PartiqlAst.DmlOp.Set) =
            transformAssignment(node.assignment)
        open fun transformDmlOpSet_metas(node: PartiqlAst.DmlOp.Set) =
            transformMetas(node.metas)
    
        // Variant DmlOpRemove
        open fun transformDmlOpRemove(node: PartiqlAst.DmlOp.Remove): PartiqlAst.DmlOp {
            val new_target = transformDmlOpRemove_target(node)
            val new_metas = transformDmlOpRemove_metas(node)
            return if (
                node.target !== new_target ||
                node.metas !== new_metas
            ) {
                PartiqlAst.DmlOp.Remove(
                    target = new_target,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformDmlOpRemove_target(node: PartiqlAst.DmlOp.Remove) =
            transformExpr(node.target)
        open fun transformDmlOpRemove_metas(node: PartiqlAst.DmlOp.Remove) =
            transformMetas(node.metas)
    
        // Variant DmlOpDelete
        open fun transformDmlOpDelete(node: PartiqlAst.DmlOp.Delete): PartiqlAst.DmlOp {
            val new_metas = transformDmlOpDelete_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.DmlOp.Delete(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformDmlOpDelete_metas(node: PartiqlAst.DmlOp.Delete) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: ConflictAction
        //////////////////////////////////////
        open fun transformConflictAction(node: PartiqlAst.ConflictAction): PartiqlAst.ConflictAction =
            when(node) {
                is PartiqlAst.ConflictAction.DoReplace -> transformConflictActionDoReplace(node)
                is PartiqlAst.ConflictAction.DoUpdate -> transformConflictActionDoUpdate(node)
                is PartiqlAst.ConflictAction.DoNothing -> transformConflictActionDoNothing(node)
            }
        // Variant ConflictActionDoReplace
        open fun transformConflictActionDoReplace(node: PartiqlAst.ConflictAction.DoReplace): PartiqlAst.ConflictAction {
            val new_value = transformConflictActionDoReplace_value(node)
            val new_metas = transformConflictActionDoReplace_metas(node)
            return if (
                node.value !== new_value ||
                node.metas !== new_metas
            ) {
                PartiqlAst.ConflictAction.DoReplace(
                    value = new_value,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformConflictActionDoReplace_value(node: PartiqlAst.ConflictAction.DoReplace) =
            transformOnConflictValue(node.value)
        open fun transformConflictActionDoReplace_metas(node: PartiqlAst.ConflictAction.DoReplace) =
            transformMetas(node.metas)
    
        // Variant ConflictActionDoUpdate
        open fun transformConflictActionDoUpdate(node: PartiqlAst.ConflictAction.DoUpdate): PartiqlAst.ConflictAction {
            val new_value = transformConflictActionDoUpdate_value(node)
            val new_metas = transformConflictActionDoUpdate_metas(node)
            return if (
                node.value !== new_value ||
                node.metas !== new_metas
            ) {
                PartiqlAst.ConflictAction.DoUpdate(
                    value = new_value,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformConflictActionDoUpdate_value(node: PartiqlAst.ConflictAction.DoUpdate) =
            transformOnConflictValue(node.value)
        open fun transformConflictActionDoUpdate_metas(node: PartiqlAst.ConflictAction.DoUpdate) =
            transformMetas(node.metas)
    
        // Variant ConflictActionDoNothing
        open fun transformConflictActionDoNothing(node: PartiqlAst.ConflictAction.DoNothing): PartiqlAst.ConflictAction {
            val new_metas = transformConflictActionDoNothing_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.ConflictAction.DoNothing(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformConflictActionDoNothing_metas(node: PartiqlAst.ConflictAction.DoNothing) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: OnConflictValue
        //////////////////////////////////////
        open fun transformOnConflictValue(node: PartiqlAst.OnConflictValue): PartiqlAst.OnConflictValue =
            when(node) {
                is PartiqlAst.OnConflictValue.Excluded -> transformOnConflictValueExcluded(node)
            }
        // Variant OnConflictValueExcluded
        open fun transformOnConflictValueExcluded(node: PartiqlAst.OnConflictValue.Excluded): PartiqlAst.OnConflictValue {
            val new_metas = transformOnConflictValueExcluded_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.OnConflictValue.Excluded(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformOnConflictValueExcluded_metas(node: PartiqlAst.OnConflictValue.Excluded) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: DdlOp
        //////////////////////////////////////
        open fun transformDdlOp(node: PartiqlAst.DdlOp): PartiqlAst.DdlOp =
            when(node) {
                is PartiqlAst.DdlOp.CreateTable -> transformDdlOpCreateTable(node)
                is PartiqlAst.DdlOp.DropTable -> transformDdlOpDropTable(node)
                is PartiqlAst.DdlOp.CreateIndex -> transformDdlOpCreateIndex(node)
                is PartiqlAst.DdlOp.DropIndex -> transformDdlOpDropIndex(node)
            }
        // Variant DdlOpCreateTable
        open fun transformDdlOpCreateTable(node: PartiqlAst.DdlOp.CreateTable): PartiqlAst.DdlOp {
            val new_tableName = transformDdlOpCreateTable_tableName(node)
            val new_metas = transformDdlOpCreateTable_metas(node)
            return if (
                node.tableName !== new_tableName ||
                node.metas !== new_metas
            ) {
                PartiqlAst.DdlOp.CreateTable(
                    tableName = new_tableName,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformDdlOpCreateTable_tableName(node: PartiqlAst.DdlOp.CreateTable) =
            transformSymbolPrimitive(node.tableName)
        open fun transformDdlOpCreateTable_metas(node: PartiqlAst.DdlOp.CreateTable) =
            transformMetas(node.metas)
    
        // Variant DdlOpDropTable
        open fun transformDdlOpDropTable(node: PartiqlAst.DdlOp.DropTable): PartiqlAst.DdlOp {
            val new_tableName = transformDdlOpDropTable_tableName(node)
            val new_metas = transformDdlOpDropTable_metas(node)
            return if (
                node.tableName !== new_tableName ||
                node.metas !== new_metas
            ) {
                PartiqlAst.DdlOp.DropTable(
                    tableName = new_tableName,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformDdlOpDropTable_tableName(node: PartiqlAst.DdlOp.DropTable) =
            transformIdentifier(node.tableName)
        open fun transformDdlOpDropTable_metas(node: PartiqlAst.DdlOp.DropTable) =
            transformMetas(node.metas)
    
        // Variant DdlOpCreateIndex
        open fun transformDdlOpCreateIndex(node: PartiqlAst.DdlOp.CreateIndex): PartiqlAst.DdlOp {
            val new_indexName = transformDdlOpCreateIndex_indexName(node)
            val new_fields = transformDdlOpCreateIndex_fields(node)
            val new_metas = transformDdlOpCreateIndex_metas(node)
            return if (
                node.indexName !== new_indexName ||
                node.fields !== new_fields ||
                node.metas !== new_metas
            ) {
                PartiqlAst.DdlOp.CreateIndex(
                    indexName = new_indexName,
                    fields = new_fields,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformDdlOpCreateIndex_indexName(node: PartiqlAst.DdlOp.CreateIndex) =
            transformIdentifier(node.indexName)
        open fun transformDdlOpCreateIndex_fields(node: PartiqlAst.DdlOp.CreateIndex) =
            node.fields.map { transformExpr(it) }
        open fun transformDdlOpCreateIndex_metas(node: PartiqlAst.DdlOp.CreateIndex) =
            transformMetas(node.metas)
    
        // Variant DdlOpDropIndex
        open fun transformDdlOpDropIndex(node: PartiqlAst.DdlOp.DropIndex): PartiqlAst.DdlOp {
            val new_table = transformDdlOpDropIndex_table(node)
            val new_keys = transformDdlOpDropIndex_keys(node)
            val new_metas = transformDdlOpDropIndex_metas(node)
            return if (
                node.table !== new_table ||
                node.keys !== new_keys ||
                node.metas !== new_metas
            ) {
                PartiqlAst.DdlOp.DropIndex(
                    table = new_table,
                    keys = new_keys,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformDdlOpDropIndex_table(node: PartiqlAst.DdlOp.DropIndex) =
            transformIdentifier(node.table)
        open fun transformDdlOpDropIndex_keys(node: PartiqlAst.DdlOp.DropIndex) =
            transformIdentifier(node.keys)
        open fun transformDdlOpDropIndex_metas(node: PartiqlAst.DdlOp.DropIndex) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: ColumnComponent
        //////////////////////////////////////
        open fun transformColumnComponent(node: PartiqlAst.ColumnComponent): PartiqlAst.ColumnComponent =
            when(node) {
                is PartiqlAst.ColumnComponent.ReturningWildcard -> transformColumnComponentReturningWildcard(node)
                is PartiqlAst.ColumnComponent.ReturningColumn -> transformColumnComponentReturningColumn(node)
            }
        // Variant ColumnComponentReturningWildcard
        open fun transformColumnComponentReturningWildcard(node: PartiqlAst.ColumnComponent.ReturningWildcard): PartiqlAst.ColumnComponent {
            val new_metas = transformColumnComponentReturningWildcard_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.ColumnComponent.ReturningWildcard(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformColumnComponentReturningWildcard_metas(node: PartiqlAst.ColumnComponent.ReturningWildcard) =
            transformMetas(node.metas)
    
        // Variant ColumnComponentReturningColumn
        open fun transformColumnComponentReturningColumn(node: PartiqlAst.ColumnComponent.ReturningColumn): PartiqlAst.ColumnComponent {
            val new_expr = transformColumnComponentReturningColumn_expr(node)
            val new_metas = transformColumnComponentReturningColumn_metas(node)
            return if (
                node.expr !== new_expr ||
                node.metas !== new_metas
            ) {
                PartiqlAst.ColumnComponent.ReturningColumn(
                    expr = new_expr,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformColumnComponentReturningColumn_expr(node: PartiqlAst.ColumnComponent.ReturningColumn) =
            transformExpr(node.expr)
        open fun transformColumnComponentReturningColumn_metas(node: PartiqlAst.ColumnComponent.ReturningColumn) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: ReturningMapping
        //////////////////////////////////////
        open fun transformReturningMapping(node: PartiqlAst.ReturningMapping): PartiqlAst.ReturningMapping =
            when(node) {
                is PartiqlAst.ReturningMapping.ModifiedNew -> transformReturningMappingModifiedNew(node)
                is PartiqlAst.ReturningMapping.ModifiedOld -> transformReturningMappingModifiedOld(node)
                is PartiqlAst.ReturningMapping.AllNew -> transformReturningMappingAllNew(node)
                is PartiqlAst.ReturningMapping.AllOld -> transformReturningMappingAllOld(node)
            }
        // Variant ReturningMappingModifiedNew
        open fun transformReturningMappingModifiedNew(node: PartiqlAst.ReturningMapping.ModifiedNew): PartiqlAst.ReturningMapping {
            val new_metas = transformReturningMappingModifiedNew_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.ReturningMapping.ModifiedNew(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformReturningMappingModifiedNew_metas(node: PartiqlAst.ReturningMapping.ModifiedNew) =
            transformMetas(node.metas)
    
        // Variant ReturningMappingModifiedOld
        open fun transformReturningMappingModifiedOld(node: PartiqlAst.ReturningMapping.ModifiedOld): PartiqlAst.ReturningMapping {
            val new_metas = transformReturningMappingModifiedOld_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.ReturningMapping.ModifiedOld(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformReturningMappingModifiedOld_metas(node: PartiqlAst.ReturningMapping.ModifiedOld) =
            transformMetas(node.metas)
    
        // Variant ReturningMappingAllNew
        open fun transformReturningMappingAllNew(node: PartiqlAst.ReturningMapping.AllNew): PartiqlAst.ReturningMapping {
            val new_metas = transformReturningMappingAllNew_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.ReturningMapping.AllNew(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformReturningMappingAllNew_metas(node: PartiqlAst.ReturningMapping.AllNew) =
            transformMetas(node.metas)
    
        // Variant ReturningMappingAllOld
        open fun transformReturningMappingAllOld(node: PartiqlAst.ReturningMapping.AllOld): PartiqlAst.ReturningMapping {
            val new_metas = transformReturningMappingAllOld_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.ReturningMapping.AllOld(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformReturningMappingAllOld_metas(node: PartiqlAst.ReturningMapping.AllOld) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: Type
        //////////////////////////////////////
        open fun transformType(node: PartiqlAst.Type): PartiqlAst.Type =
            when(node) {
                is PartiqlAst.Type.NullType -> transformTypeNullType(node)
                is PartiqlAst.Type.BooleanType -> transformTypeBooleanType(node)
                is PartiqlAst.Type.SmallintType -> transformTypeSmallintType(node)
                is PartiqlAst.Type.Integer4Type -> transformTypeInteger4Type(node)
                is PartiqlAst.Type.Integer8Type -> transformTypeInteger8Type(node)
                is PartiqlAst.Type.IntegerType -> transformTypeIntegerType(node)
                is PartiqlAst.Type.FloatType -> transformTypeFloatType(node)
                is PartiqlAst.Type.RealType -> transformTypeRealType(node)
                is PartiqlAst.Type.DoublePrecisionType -> transformTypeDoublePrecisionType(node)
                is PartiqlAst.Type.DecimalType -> transformTypeDecimalType(node)
                is PartiqlAst.Type.NumericType -> transformTypeNumericType(node)
                is PartiqlAst.Type.TimestampType -> transformTypeTimestampType(node)
                is PartiqlAst.Type.CharacterType -> transformTypeCharacterType(node)
                is PartiqlAst.Type.CharacterVaryingType -> transformTypeCharacterVaryingType(node)
                is PartiqlAst.Type.MissingType -> transformTypeMissingType(node)
                is PartiqlAst.Type.StringType -> transformTypeStringType(node)
                is PartiqlAst.Type.SymbolType -> transformTypeSymbolType(node)
                is PartiqlAst.Type.BlobType -> transformTypeBlobType(node)
                is PartiqlAst.Type.ClobType -> transformTypeClobType(node)
                is PartiqlAst.Type.DateType -> transformTypeDateType(node)
                is PartiqlAst.Type.TimeType -> transformTypeTimeType(node)
                is PartiqlAst.Type.TimeWithTimeZoneType -> transformTypeTimeWithTimeZoneType(node)
                is PartiqlAst.Type.StructType -> transformTypeStructType(node)
                is PartiqlAst.Type.TupleType -> transformTypeTupleType(node)
                is PartiqlAst.Type.ListType -> transformTypeListType(node)
                is PartiqlAst.Type.SexpType -> transformTypeSexpType(node)
                is PartiqlAst.Type.BagType -> transformTypeBagType(node)
                is PartiqlAst.Type.AnyType -> transformTypeAnyType(node)
                is PartiqlAst.Type.CustomType -> transformTypeCustomType(node)
            }
        // Variant TypeNullType
        open fun transformTypeNullType(node: PartiqlAst.Type.NullType): PartiqlAst.Type {
            val new_metas = transformTypeNullType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.NullType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeNullType_metas(node: PartiqlAst.Type.NullType) =
            transformMetas(node.metas)
    
        // Variant TypeBooleanType
        open fun transformTypeBooleanType(node: PartiqlAst.Type.BooleanType): PartiqlAst.Type {
            val new_metas = transformTypeBooleanType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.BooleanType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeBooleanType_metas(node: PartiqlAst.Type.BooleanType) =
            transformMetas(node.metas)
    
        // Variant TypeSmallintType
        open fun transformTypeSmallintType(node: PartiqlAst.Type.SmallintType): PartiqlAst.Type {
            val new_metas = transformTypeSmallintType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.SmallintType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeSmallintType_metas(node: PartiqlAst.Type.SmallintType) =
            transformMetas(node.metas)
    
        // Variant TypeInteger4Type
        open fun transformTypeInteger4Type(node: PartiqlAst.Type.Integer4Type): PartiqlAst.Type {
            val new_metas = transformTypeInteger4Type_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.Integer4Type(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeInteger4Type_metas(node: PartiqlAst.Type.Integer4Type) =
            transformMetas(node.metas)
    
        // Variant TypeInteger8Type
        open fun transformTypeInteger8Type(node: PartiqlAst.Type.Integer8Type): PartiqlAst.Type {
            val new_metas = transformTypeInteger8Type_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.Integer8Type(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeInteger8Type_metas(node: PartiqlAst.Type.Integer8Type) =
            transformMetas(node.metas)
    
        // Variant TypeIntegerType
        open fun transformTypeIntegerType(node: PartiqlAst.Type.IntegerType): PartiqlAst.Type {
            val new_metas = transformTypeIntegerType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.IntegerType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeIntegerType_metas(node: PartiqlAst.Type.IntegerType) =
            transformMetas(node.metas)
    
        // Variant TypeFloatType
        open fun transformTypeFloatType(node: PartiqlAst.Type.FloatType): PartiqlAst.Type {
            val new_precision = transformTypeFloatType_precision(node)
            val new_metas = transformTypeFloatType_metas(node)
            return if (
                node.precision !== new_precision ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.FloatType(
                    precision = new_precision,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeFloatType_precision(node: PartiqlAst.Type.FloatType) =
            node.precision?.let { transformLongPrimitive(it) }
        open fun transformTypeFloatType_metas(node: PartiqlAst.Type.FloatType) =
            transformMetas(node.metas)
    
        // Variant TypeRealType
        open fun transformTypeRealType(node: PartiqlAst.Type.RealType): PartiqlAst.Type {
            val new_metas = transformTypeRealType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.RealType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeRealType_metas(node: PartiqlAst.Type.RealType) =
            transformMetas(node.metas)
    
        // Variant TypeDoublePrecisionType
        open fun transformTypeDoublePrecisionType(node: PartiqlAst.Type.DoublePrecisionType): PartiqlAst.Type {
            val new_metas = transformTypeDoublePrecisionType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.DoublePrecisionType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeDoublePrecisionType_metas(node: PartiqlAst.Type.DoublePrecisionType) =
            transformMetas(node.metas)
    
        // Variant TypeDecimalType
        open fun transformTypeDecimalType(node: PartiqlAst.Type.DecimalType): PartiqlAst.Type {
            val new_precision = transformTypeDecimalType_precision(node)
            val new_scale = transformTypeDecimalType_scale(node)
            val new_metas = transformTypeDecimalType_metas(node)
            return if (
                node.precision !== new_precision ||
                node.scale !== new_scale ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.DecimalType(
                    precision = new_precision,
                    scale = new_scale,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeDecimalType_precision(node: PartiqlAst.Type.DecimalType) =
            node.precision?.let { transformLongPrimitive(it) }
        open fun transformTypeDecimalType_scale(node: PartiqlAst.Type.DecimalType) =
            node.scale?.let { transformLongPrimitive(it) }
        open fun transformTypeDecimalType_metas(node: PartiqlAst.Type.DecimalType) =
            transformMetas(node.metas)
    
        // Variant TypeNumericType
        open fun transformTypeNumericType(node: PartiqlAst.Type.NumericType): PartiqlAst.Type {
            val new_precision = transformTypeNumericType_precision(node)
            val new_scale = transformTypeNumericType_scale(node)
            val new_metas = transformTypeNumericType_metas(node)
            return if (
                node.precision !== new_precision ||
                node.scale !== new_scale ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.NumericType(
                    precision = new_precision,
                    scale = new_scale,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeNumericType_precision(node: PartiqlAst.Type.NumericType) =
            node.precision?.let { transformLongPrimitive(it) }
        open fun transformTypeNumericType_scale(node: PartiqlAst.Type.NumericType) =
            node.scale?.let { transformLongPrimitive(it) }
        open fun transformTypeNumericType_metas(node: PartiqlAst.Type.NumericType) =
            transformMetas(node.metas)
    
        // Variant TypeTimestampType
        open fun transformTypeTimestampType(node: PartiqlAst.Type.TimestampType): PartiqlAst.Type {
            val new_metas = transformTypeTimestampType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.TimestampType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeTimestampType_metas(node: PartiqlAst.Type.TimestampType) =
            transformMetas(node.metas)
    
        // Variant TypeCharacterType
        open fun transformTypeCharacterType(node: PartiqlAst.Type.CharacterType): PartiqlAst.Type {
            val new_length = transformTypeCharacterType_length(node)
            val new_metas = transformTypeCharacterType_metas(node)
            return if (
                node.length !== new_length ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.CharacterType(
                    length = new_length,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeCharacterType_length(node: PartiqlAst.Type.CharacterType) =
            node.length?.let { transformLongPrimitive(it) }
        open fun transformTypeCharacterType_metas(node: PartiqlAst.Type.CharacterType) =
            transformMetas(node.metas)
    
        // Variant TypeCharacterVaryingType
        open fun transformTypeCharacterVaryingType(node: PartiqlAst.Type.CharacterVaryingType): PartiqlAst.Type {
            val new_length = transformTypeCharacterVaryingType_length(node)
            val new_metas = transformTypeCharacterVaryingType_metas(node)
            return if (
                node.length !== new_length ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.CharacterVaryingType(
                    length = new_length,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeCharacterVaryingType_length(node: PartiqlAst.Type.CharacterVaryingType) =
            node.length?.let { transformLongPrimitive(it) }
        open fun transformTypeCharacterVaryingType_metas(node: PartiqlAst.Type.CharacterVaryingType) =
            transformMetas(node.metas)
    
        // Variant TypeMissingType
        open fun transformTypeMissingType(node: PartiqlAst.Type.MissingType): PartiqlAst.Type {
            val new_metas = transformTypeMissingType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.MissingType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeMissingType_metas(node: PartiqlAst.Type.MissingType) =
            transformMetas(node.metas)
    
        // Variant TypeStringType
        open fun transformTypeStringType(node: PartiqlAst.Type.StringType): PartiqlAst.Type {
            val new_metas = transformTypeStringType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.StringType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeStringType_metas(node: PartiqlAst.Type.StringType) =
            transformMetas(node.metas)
    
        // Variant TypeSymbolType
        open fun transformTypeSymbolType(node: PartiqlAst.Type.SymbolType): PartiqlAst.Type {
            val new_metas = transformTypeSymbolType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.SymbolType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeSymbolType_metas(node: PartiqlAst.Type.SymbolType) =
            transformMetas(node.metas)
    
        // Variant TypeBlobType
        open fun transformTypeBlobType(node: PartiqlAst.Type.BlobType): PartiqlAst.Type {
            val new_metas = transformTypeBlobType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.BlobType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeBlobType_metas(node: PartiqlAst.Type.BlobType) =
            transformMetas(node.metas)
    
        // Variant TypeClobType
        open fun transformTypeClobType(node: PartiqlAst.Type.ClobType): PartiqlAst.Type {
            val new_metas = transformTypeClobType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.ClobType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeClobType_metas(node: PartiqlAst.Type.ClobType) =
            transformMetas(node.metas)
    
        // Variant TypeDateType
        open fun transformTypeDateType(node: PartiqlAst.Type.DateType): PartiqlAst.Type {
            val new_metas = transformTypeDateType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.DateType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeDateType_metas(node: PartiqlAst.Type.DateType) =
            transformMetas(node.metas)
    
        // Variant TypeTimeType
        open fun transformTypeTimeType(node: PartiqlAst.Type.TimeType): PartiqlAst.Type {
            val new_precision = transformTypeTimeType_precision(node)
            val new_metas = transformTypeTimeType_metas(node)
            return if (
                node.precision !== new_precision ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.TimeType(
                    precision = new_precision,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeTimeType_precision(node: PartiqlAst.Type.TimeType) =
            node.precision?.let { transformLongPrimitive(it) }
        open fun transformTypeTimeType_metas(node: PartiqlAst.Type.TimeType) =
            transformMetas(node.metas)
    
        // Variant TypeTimeWithTimeZoneType
        open fun transformTypeTimeWithTimeZoneType(node: PartiqlAst.Type.TimeWithTimeZoneType): PartiqlAst.Type {
            val new_precision = transformTypeTimeWithTimeZoneType_precision(node)
            val new_metas = transformTypeTimeWithTimeZoneType_metas(node)
            return if (
                node.precision !== new_precision ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.TimeWithTimeZoneType(
                    precision = new_precision,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeTimeWithTimeZoneType_precision(node: PartiqlAst.Type.TimeWithTimeZoneType) =
            node.precision?.let { transformLongPrimitive(it) }
        open fun transformTypeTimeWithTimeZoneType_metas(node: PartiqlAst.Type.TimeWithTimeZoneType) =
            transformMetas(node.metas)
    
        // Variant TypeStructType
        open fun transformTypeStructType(node: PartiqlAst.Type.StructType): PartiqlAst.Type {
            val new_metas = transformTypeStructType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.StructType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeStructType_metas(node: PartiqlAst.Type.StructType) =
            transformMetas(node.metas)
    
        // Variant TypeTupleType
        open fun transformTypeTupleType(node: PartiqlAst.Type.TupleType): PartiqlAst.Type {
            val new_metas = transformTypeTupleType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.TupleType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeTupleType_metas(node: PartiqlAst.Type.TupleType) =
            transformMetas(node.metas)
    
        // Variant TypeListType
        open fun transformTypeListType(node: PartiqlAst.Type.ListType): PartiqlAst.Type {
            val new_metas = transformTypeListType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.ListType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeListType_metas(node: PartiqlAst.Type.ListType) =
            transformMetas(node.metas)
    
        // Variant TypeSexpType
        open fun transformTypeSexpType(node: PartiqlAst.Type.SexpType): PartiqlAst.Type {
            val new_metas = transformTypeSexpType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.SexpType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeSexpType_metas(node: PartiqlAst.Type.SexpType) =
            transformMetas(node.metas)
    
        // Variant TypeBagType
        open fun transformTypeBagType(node: PartiqlAst.Type.BagType): PartiqlAst.Type {
            val new_metas = transformTypeBagType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.BagType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeBagType_metas(node: PartiqlAst.Type.BagType) =
            transformMetas(node.metas)
    
        // Variant TypeAnyType
        open fun transformTypeAnyType(node: PartiqlAst.Type.AnyType): PartiqlAst.Type {
            val new_metas = transformTypeAnyType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.AnyType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeAnyType_metas(node: PartiqlAst.Type.AnyType) =
            transformMetas(node.metas)
    
        // Variant TypeCustomType
        open fun transformTypeCustomType(node: PartiqlAst.Type.CustomType): PartiqlAst.Type {
            val new_name = transformTypeCustomType_name(node)
            val new_metas = transformTypeCustomType_metas(node)
            return if (
                node.name !== new_name ||
                node.metas !== new_metas
            ) {
                PartiqlAst.Type.CustomType(
                    name = new_name,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeCustomType_name(node: PartiqlAst.Type.CustomType) =
            transformSymbolPrimitive(node.name)
        open fun transformTypeCustomType_metas(node: PartiqlAst.Type.CustomType) =
            transformMetas(node.metas)
    
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy