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

org.partiql.lang.domains.PartiqlPhysical.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 PartiqlPhysical private constructor() {
    /////////////////////////////////////////////////////////////////////////////
    // Builder
    /////////////////////////////////////////////////////////////////////////////
    companion object {
        @JvmStatic
        fun BUILDER() : Builder = PartiqlPhysicalBuilder
    
        fun  build(block: Builder.() -> T) =
            PartiqlPhysicalBuilder.block()
    
        fun transform(element: AnyElement): PartiqlPhysicalNode =
            transform(element.asSexp())
    
        fun transform(element: SexpElement): PartiqlPhysicalNode =
            IonElementTransformer().transform(element)
    }
    
    interface Builder {
        fun newMetaContainer() = emptyMetaContainer()
    
        // Tuples 
        /**
         * Creates an instance of [PartiqlPhysical.TimeValue].
         */
        fun timeValue(
            hour: Long,
            minute: Long,
            second: Long,
            nano: Long,
            precision: Long,
            withTimeZone: Boolean,
            tzMinutes: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.TimeValue =
            PartiqlPhysical.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 [PartiqlPhysical.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()
        ): PartiqlPhysical.TimeValue =
            PartiqlPhysical.TimeValue(
                hour = hour,
                minute = minute,
                second = second,
                nano = nano,
                precision = precision,
                withTimeZone = withTimeZone,
                tzMinutes = tzMinutes,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchQuantifier].
         */
        fun graphMatchQuantifier(
            lower: Long,
            upper: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchQuantifier =
            PartiqlPhysical.GraphMatchQuantifier(
                lower = lower.asPrimitive(),
                upper = upper?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.GraphMatchQuantifier =
            PartiqlPhysical.GraphMatchQuantifier(
                lower = lower,
                upper = upper,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchPattern].
         */
        fun graphMatchPattern(
            restrictor: GraphMatchRestrictor? = null,
            prefilter: Expr? = null,
            variable: String? = null,
            quantifier: GraphMatchQuantifier? = null,
            parts: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchPattern =
            PartiqlPhysical.GraphMatchPattern(
                restrictor = restrictor,
                prefilter = prefilter,
                variable = variable?.asPrimitive(),
                quantifier = quantifier,
                parts = parts,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.GraphMatchPattern =
            PartiqlPhysical.GraphMatchPattern(
                restrictor = restrictor,
                prefilter = prefilter,
                variable = variable,
                quantifier = quantifier,
                parts = parts,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchPattern].
         */
        fun graphMatchPattern(
            restrictor: GraphMatchRestrictor? = null,
            prefilter: Expr? = null,
            variable: String? = null,
            quantifier: GraphMatchQuantifier? = null,
            parts0: GraphMatchPatternPart,
            vararg parts: GraphMatchPatternPart,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchPattern =
            PartiqlPhysical.GraphMatchPattern(
                restrictor = restrictor,
                prefilter = prefilter,
                variable = variable?.asPrimitive(),
                quantifier = quantifier,
                parts = listOf(parts0) + parts.toList(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.GraphMatchPattern =
            PartiqlPhysical.GraphMatchPattern(
                restrictor = restrictor,
                prefilter = prefilter,
                variable = variable,
                quantifier = quantifier,
                parts = listOf(parts0) + parts.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GpmlPattern].
         */
        fun gpmlPattern(
            selector: GraphMatchSelector? = null,
            patterns: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GpmlPattern =
            PartiqlPhysical.GpmlPattern(
                selector = selector,
                patterns = patterns,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.GpmlPattern].
         */
        fun gpmlPattern(
            selector: GraphMatchSelector? = null,
            patterns0: GraphMatchPattern,
            vararg patterns: GraphMatchPattern,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GpmlPattern =
            PartiqlPhysical.GpmlPattern(
                selector = selector,
                patterns = listOf(patterns0) + patterns.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.ExprPair].
         */
        fun exprPair(
            first: Expr,
            second: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.ExprPair =
            PartiqlPhysical.ExprPair(
                first = first,
                second = second,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.ExprPairList].
         */
        fun exprPairList(
            pairs: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.ExprPairList =
            PartiqlPhysical.ExprPairList(
                pairs = pairs,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.ExprPairList].
         */
        fun exprPairList(
            vararg pairs: ExprPair,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.ExprPairList =
            PartiqlPhysical.ExprPairList(
                pairs = pairs.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.SortSpec].
         */
        fun sortSpec(
            expr: Expr,
            orderingSpec: OrderingSpec? = null,
            nullsSpec: NullsSpec? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.SortSpec =
            PartiqlPhysical.SortSpec(
                expr = expr,
                orderingSpec = orderingSpec,
                nullsSpec = nullsSpec,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Over].
         */
        fun over(
            partitionBy: WindowPartitionList? = null,
            orderBy: WindowSortSpecList? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Over =
            PartiqlPhysical.Over(
                partitionBy = partitionBy,
                orderBy = orderBy,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.WindowPartitionList].
         */
        fun windowPartitionList(
            exprs: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.WindowPartitionList =
            PartiqlPhysical.WindowPartitionList(
                exprs = exprs,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.WindowPartitionList].
         */
        fun windowPartitionList(
            exprs0: Expr,
            vararg exprs: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.WindowPartitionList =
            PartiqlPhysical.WindowPartitionList(
                exprs = listOf(exprs0) + exprs.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.WindowSortSpecList].
         */
        fun windowSortSpecList(
            sortSpecs: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.WindowSortSpecList =
            PartiqlPhysical.WindowSortSpecList(
                sortSpecs = sortSpecs,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.WindowSortSpecList].
         */
        fun windowSortSpecList(
            sortSpecs0: SortSpec,
            vararg sortSpecs: SortSpec,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.WindowSortSpecList =
            PartiqlPhysical.WindowSortSpecList(
                sortSpecs = listOf(sortSpecs0) + sortSpecs.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Identifier].
         */
        fun identifier(
            name: String,
            case: CaseSensitivity,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Identifier =
            PartiqlPhysical.Identifier(
                name = name.asPrimitive(),
                case = case,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Identifier =
            PartiqlPhysical.Identifier(
                name = name,
                case = case,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.LetBinding].
         */
        fun letBinding(
            value: Expr,
            decl: VarDecl,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.LetBinding =
            PartiqlPhysical.LetBinding(
                value = value,
                decl = decl,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GroupKey].
         */
        fun groupKey(
            expr: Expr,
            asVar: VarDecl,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GroupKey =
            PartiqlPhysical.GroupKey(
                expr = expr,
                asVar = asVar,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GroupKeyList].
         */
        fun groupKeyList(
            keys: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GroupKeyList =
            PartiqlPhysical.GroupKeyList(
                keys = keys,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.GroupKeyList].
         */
        fun groupKeyList(
            keys0: GroupKey,
            vararg keys: GroupKey,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GroupKeyList =
            PartiqlPhysical.GroupKeyList(
                keys = listOf(keys0) + keys.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.AggregateFunction].
         */
        fun aggregateFunction(
            quantifier: SetQuantifier,
            name: String,
            arg: Expr,
            asVar: VarDecl,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.AggregateFunction =
            PartiqlPhysical.AggregateFunction(
                quantifier = quantifier,
                name = name.asPrimitive(),
                arg = arg,
                asVar = asVar,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.AggregateFunction].
         *
         * 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 aggregateFunction_(
            quantifier: SetQuantifier,
            name: org.partiql.pig.runtime.SymbolPrimitive,
            arg: Expr,
            asVar: VarDecl,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.AggregateFunction =
            PartiqlPhysical.AggregateFunction(
                quantifier = quantifier,
                name = name,
                arg = arg,
                asVar = asVar,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.AggregateFunctionList].
         */
        fun aggregateFunctionList(
            functions: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.AggregateFunctionList =
            PartiqlPhysical.AggregateFunctionList(
                functions = functions,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.AggregateFunctionList].
         */
        fun aggregateFunctionList(
            functions0: AggregateFunction,
            vararg functions: AggregateFunction,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.AggregateFunctionList =
            PartiqlPhysical.AggregateFunctionList(
                functions = listOf(functions0) + functions.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.WindowExpression].
         */
        fun windowExpression(
            decl: VarDecl,
            funcName: String,
            args: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.WindowExpression =
            PartiqlPhysical.WindowExpression(
                decl = decl,
                funcName = funcName.asPrimitive(),
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.WindowExpression].
         *
         * 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 windowExpression_(
            decl: VarDecl,
            funcName: org.partiql.pig.runtime.SymbolPrimitive,
            args: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.WindowExpression =
            PartiqlPhysical.WindowExpression(
                decl = decl,
                funcName = funcName,
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.WindowExpression].
         */
        fun windowExpression(
            decl: VarDecl,
            funcName: String,
            args0: Expr,
            vararg args: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.WindowExpression =
            PartiqlPhysical.WindowExpression(
                decl = decl,
                funcName = funcName?.asPrimitive(),
                args = listOf(args0) + args.toList(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.WindowExpression].
         *
         * 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 windowExpression_(
            decl: VarDecl,
            funcName: org.partiql.pig.runtime.SymbolPrimitive,
            args0: Expr,
            vararg args: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.WindowExpression =
            PartiqlPhysical.WindowExpression(
                decl = decl,
                funcName = funcName,
                args = listOf(args0) + args.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Plan].
         */
        fun plan(
            stmt: Statement,
            version: String,
            locals: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Plan =
            PartiqlPhysical.Plan(
                stmt = stmt,
                version = version.asPrimitive(),
                locals = locals,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Plan].
         *
         * 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 plan_(
            stmt: Statement,
            version: org.partiql.pig.runtime.SymbolPrimitive,
            locals: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Plan =
            PartiqlPhysical.Plan(
                stmt = stmt,
                version = version,
                locals = locals,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.LocalVariable].
         */
        fun localVariable(
            name: String,
            registerIndex: Long,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.LocalVariable =
            PartiqlPhysical.LocalVariable(
                name = name.asPrimitive(),
                registerIndex = registerIndex.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.LocalVariable].
         *
         * 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 localVariable_(
            name: org.partiql.pig.runtime.SymbolPrimitive,
            registerIndex: org.partiql.pig.runtime.LongPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.LocalVariable =
            PartiqlPhysical.LocalVariable(
                name = name,
                registerIndex = registerIndex,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.VarDecl].
         */
        fun varDecl(
            index: Long,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.VarDecl =
            PartiqlPhysical.VarDecl(
                index = index.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.VarDecl].
         *
         * 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 varDecl_(
            index: org.partiql.pig.runtime.LongPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.VarDecl =
            PartiqlPhysical.VarDecl(
                index = index,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Impl].
         */
        fun impl(
            name: String,
            staticArgs: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Impl =
            PartiqlPhysical.Impl(
                name = name.asPrimitive(),
                staticArgs = staticArgs.asAnyElement(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Impl].
         *
         * 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 impl_(
            name: org.partiql.pig.runtime.SymbolPrimitive,
            staticArgs: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Impl =
            PartiqlPhysical.Impl(
                name = name,
                staticArgs = staticArgs.asAnyElement(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Impl].
         */
        fun impl(
            name: String,
            vararg staticArgs: com.amazon.ionelement.api.AnyElement,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Impl =
            PartiqlPhysical.Impl(
                name = name?.asPrimitive(),
                staticArgs = staticArgs.toList(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Impl].
         *
         * 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 impl_(
            name: org.partiql.pig.runtime.SymbolPrimitive,
            vararg staticArgs: com.amazon.ionelement.api.AnyElement,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Impl =
            PartiqlPhysical.Impl(
                name = name,
                staticArgs = staticArgs.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: ExplainTarget 
        /**
         * Creates an instance of [PartiqlPhysical.ExplainTarget.Domain].
         */
        fun domain(
            statement: Statement,
            type: String? = null,
            format: String? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.ExplainTarget.Domain =
            PartiqlPhysical.ExplainTarget.Domain(
                statement = statement,
                type = type?.asPrimitive(),
                format = format?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.ExplainTarget.Domain =
            PartiqlPhysical.ExplainTarget.Domain(
                statement = statement,
                type = type,
                format = format,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: PathStep 
        /**
         * Creates an instance of [PartiqlPhysical.PathStep.PathExpr].
         */
        fun pathExpr(
            index: Expr,
            case: CaseSensitivity,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.PathStep.PathExpr =
            PartiqlPhysical.PathStep.PathExpr(
                index = index,
                case = case,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.PathStep.PathWildcard].
         */
        fun pathWildcard(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.PathStep.PathWildcard =
            PartiqlPhysical.PathStep.PathWildcard(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.PathStep.PathUnpivot].
         */
        fun pathUnpivot(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.PathStep.PathUnpivot =
            PartiqlPhysical.PathStep.PathUnpivot(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: JoinType 
        /**
         * Creates an instance of [PartiqlPhysical.JoinType.Inner].
         */
        fun inner(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.JoinType.Inner =
            PartiqlPhysical.JoinType.Inner(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.JoinType.Left].
         */
        fun left(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.JoinType.Left =
            PartiqlPhysical.JoinType.Left(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.JoinType.Right].
         */
        fun right(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.JoinType.Right =
            PartiqlPhysical.JoinType.Right(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.JoinType.Full].
         */
        fun full(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.JoinType.Full =
            PartiqlPhysical.JoinType.Full(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: GraphMatchDirection 
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchDirection.EdgeLeft].
         */
        fun edgeLeft(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchDirection.EdgeLeft =
            PartiqlPhysical.GraphMatchDirection.EdgeLeft(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchDirection.EdgeUndirected].
         */
        fun edgeUndirected(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchDirection.EdgeUndirected =
            PartiqlPhysical.GraphMatchDirection.EdgeUndirected(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchDirection.EdgeRight].
         */
        fun edgeRight(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchDirection.EdgeRight =
            PartiqlPhysical.GraphMatchDirection.EdgeRight(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected].
         */
        fun edgeLeftOrUndirected(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected =
            PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight].
         */
        fun edgeUndirectedOrRight(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight =
            PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight].
         */
        fun edgeLeftOrRight(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight =
            PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight].
         */
        fun edgeLeftOrUndirectedOrRight(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight =
            PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: GraphMatchPatternPart 
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchPatternPart.Node].
         */
        fun node(
            prefilter: Expr? = null,
            variable: String? = null,
            label: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchPatternPart.Node =
            PartiqlPhysical.GraphMatchPatternPart.Node(
                prefilter = prefilter,
                variable = variable?.asPrimitive(),
                label = label.map { it.asPrimitive() },
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.GraphMatchPatternPart.Node =
            PartiqlPhysical.GraphMatchPatternPart.Node(
                prefilter = prefilter,
                variable = variable,
                label = label,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchPatternPart.Node].
         */
        fun node(
            prefilter: Expr? = null,
            variable: String? = null,
            vararg label: String,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchPatternPart.Node =
            PartiqlPhysical.GraphMatchPatternPart.Node(
                prefilter = prefilter,
                variable = variable?.asPrimitive(),
                label = label.map { it.asPrimitive() },
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.GraphMatchPatternPart.Node =
            PartiqlPhysical.GraphMatchPatternPart.Node(
                prefilter = prefilter,
                variable = variable,
                label = label.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchPatternPart.Edge].
         */
        fun edge(
            direction: GraphMatchDirection,
            quantifier: GraphMatchQuantifier? = null,
            prefilter: Expr? = null,
            variable: String? = null,
            label: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchPatternPart.Edge =
            PartiqlPhysical.GraphMatchPatternPart.Edge(
                direction = direction,
                quantifier = quantifier,
                prefilter = prefilter,
                variable = variable?.asPrimitive(),
                label = label.map { it.asPrimitive() },
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.GraphMatchPatternPart.Edge =
            PartiqlPhysical.GraphMatchPatternPart.Edge(
                direction = direction,
                quantifier = quantifier,
                prefilter = prefilter,
                variable = variable,
                label = label,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchPatternPart.Edge].
         */
        fun edge(
            direction: GraphMatchDirection,
            quantifier: GraphMatchQuantifier? = null,
            prefilter: Expr? = null,
            variable: String? = null,
            vararg label: String,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchPatternPart.Edge =
            PartiqlPhysical.GraphMatchPatternPart.Edge(
                direction = direction,
                quantifier = quantifier,
                prefilter = prefilter,
                variable = variable?.asPrimitive(),
                label = label.map { it.asPrimitive() },
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.GraphMatchPatternPart.Edge =
            PartiqlPhysical.GraphMatchPatternPart.Edge(
                direction = direction,
                quantifier = quantifier,
                prefilter = prefilter,
                variable = variable,
                label = label.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchPatternPart.Pattern].
         */
        fun pattern(
            pattern: GraphMatchPattern,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchPatternPart.Pattern =
            PartiqlPhysical.GraphMatchPatternPart.Pattern(
                pattern = pattern,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: GraphMatchRestrictor 
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail].
         */
        fun restrictorTrail(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail =
            PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic].
         */
        fun restrictorAcyclic(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic =
            PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple].
         */
        fun restrictorSimple(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple =
            PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: GraphMatchSelector 
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest].
         */
        fun selectorAnyShortest(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest =
            PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchSelector.SelectorAllShortest].
         */
        fun selectorAllShortest(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchSelector.SelectorAllShortest =
            PartiqlPhysical.GraphMatchSelector.SelectorAllShortest(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchSelector.SelectorAny].
         */
        fun selectorAny(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchSelector.SelectorAny =
            PartiqlPhysical.GraphMatchSelector.SelectorAny(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchSelector.SelectorAnyK].
         */
        fun selectorAnyK(
            k: Long,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchSelector.SelectorAnyK =
            PartiqlPhysical.GraphMatchSelector.SelectorAnyK(
                k = k.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.GraphMatchSelector.SelectorAnyK =
            PartiqlPhysical.GraphMatchSelector.SelectorAnyK(
                k = k,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchSelector.SelectorShortestK].
         */
        fun selectorShortestK(
            k: Long,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchSelector.SelectorShortestK =
            PartiqlPhysical.GraphMatchSelector.SelectorShortestK(
                k = k.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.GraphMatchSelector.SelectorShortestK =
            PartiqlPhysical.GraphMatchSelector.SelectorShortestK(
                k = k,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup].
         */
        fun selectorShortestKGroup(
            k: Long,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup =
            PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup(
                k = k.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup =
            PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup(
                k = k,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: GroupingStrategy 
        /**
         * Creates an instance of [PartiqlPhysical.GroupingStrategy.GroupFull].
         */
        fun groupFull(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GroupingStrategy.GroupFull =
            PartiqlPhysical.GroupingStrategy.GroupFull(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.GroupingStrategy.GroupPartial].
         */
        fun groupPartial(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.GroupingStrategy.GroupPartial =
            PartiqlPhysical.GroupingStrategy.GroupPartial(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: OrderingSpec 
        /**
         * Creates an instance of [PartiqlPhysical.OrderingSpec.Asc].
         */
        fun asc(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.OrderingSpec.Asc =
            PartiqlPhysical.OrderingSpec.Asc(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.OrderingSpec.Desc].
         */
        fun desc(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.OrderingSpec.Desc =
            PartiqlPhysical.OrderingSpec.Desc(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: NullsSpec 
        /**
         * Creates an instance of [PartiqlPhysical.NullsSpec.NullsFirst].
         */
        fun nullsFirst(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.NullsSpec.NullsFirst =
            PartiqlPhysical.NullsSpec.NullsFirst(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.NullsSpec.NullsLast].
         */
        fun nullsLast(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.NullsSpec.NullsLast =
            PartiqlPhysical.NullsSpec.NullsLast(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: CaseSensitivity 
        /**
         * Creates an instance of [PartiqlPhysical.CaseSensitivity.CaseSensitive].
         */
        fun caseSensitive(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.CaseSensitivity.CaseSensitive =
            PartiqlPhysical.CaseSensitivity.CaseSensitive(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.CaseSensitivity.CaseInsensitive].
         */
        fun caseInsensitive(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.CaseSensitivity.CaseInsensitive =
            PartiqlPhysical.CaseSensitivity.CaseInsensitive(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: SetQuantifier 
        /**
         * Creates an instance of [PartiqlPhysical.SetQuantifier.All].
         */
        fun all(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.SetQuantifier.All =
            PartiqlPhysical.SetQuantifier.All(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.SetQuantifier.Distinct].
         */
        fun distinct(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.SetQuantifier.Distinct =
            PartiqlPhysical.SetQuantifier.Distinct(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: BagOpType 
        /**
         * Creates an instance of [PartiqlPhysical.BagOpType.Union].
         */
        fun union(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.BagOpType.Union =
            PartiqlPhysical.BagOpType.Union(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.BagOpType.Intersect].
         */
        fun intersect(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.BagOpType.Intersect =
            PartiqlPhysical.BagOpType.Intersect(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.BagOpType.Except].
         */
        fun except(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.BagOpType.Except =
            PartiqlPhysical.BagOpType.Except(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.BagOpType.OuterUnion].
         */
        fun outerUnion(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.BagOpType.OuterUnion =
            PartiqlPhysical.BagOpType.OuterUnion(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.BagOpType.OuterIntersect].
         */
        fun outerIntersect(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.BagOpType.OuterIntersect =
            PartiqlPhysical.BagOpType.OuterIntersect(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.BagOpType.OuterExcept].
         */
        fun outerExcept(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.BagOpType.OuterExcept =
            PartiqlPhysical.BagOpType.OuterExcept(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: OnConflictValue 
        /**
         * Creates an instance of [PartiqlPhysical.OnConflictValue.Excluded].
         */
        fun excluded(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.OnConflictValue.Excluded =
            PartiqlPhysical.OnConflictValue.Excluded(
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: Type 
        /**
         * Creates an instance of [PartiqlPhysical.Type.NullType].
         */
        fun nullType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.NullType =
            PartiqlPhysical.Type.NullType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.BooleanType].
         */
        fun booleanType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.BooleanType =
            PartiqlPhysical.Type.BooleanType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.SmallintType].
         */
        fun smallintType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.SmallintType =
            PartiqlPhysical.Type.SmallintType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.Integer4Type].
         */
        fun integer4Type(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.Integer4Type =
            PartiqlPhysical.Type.Integer4Type(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.Integer8Type].
         */
        fun integer8Type(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.Integer8Type =
            PartiqlPhysical.Type.Integer8Type(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.IntegerType].
         */
        fun integerType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.IntegerType =
            PartiqlPhysical.Type.IntegerType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.FloatType].
         */
        fun floatType(
            precision: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.FloatType =
            PartiqlPhysical.Type.FloatType(
                precision = precision?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Type.FloatType =
            PartiqlPhysical.Type.FloatType(
                precision = precision,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.RealType].
         */
        fun realType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.RealType =
            PartiqlPhysical.Type.RealType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.DoublePrecisionType].
         */
        fun doublePrecisionType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.DoublePrecisionType =
            PartiqlPhysical.Type.DoublePrecisionType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.DecimalType].
         */
        fun decimalType(
            precision: Long? = null,
            scale: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.DecimalType =
            PartiqlPhysical.Type.DecimalType(
                precision = precision?.asPrimitive(),
                scale = scale?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Type.DecimalType =
            PartiqlPhysical.Type.DecimalType(
                precision = precision,
                scale = scale,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.NumericType].
         */
        fun numericType(
            precision: Long? = null,
            scale: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.NumericType =
            PartiqlPhysical.Type.NumericType(
                precision = precision?.asPrimitive(),
                scale = scale?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Type.NumericType =
            PartiqlPhysical.Type.NumericType(
                precision = precision,
                scale = scale,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.TimestampType].
         */
        fun timestampType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.TimestampType =
            PartiqlPhysical.Type.TimestampType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.CharacterType].
         */
        fun characterType(
            length: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.CharacterType =
            PartiqlPhysical.Type.CharacterType(
                length = length?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Type.CharacterType =
            PartiqlPhysical.Type.CharacterType(
                length = length,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.CharacterVaryingType].
         */
        fun characterVaryingType(
            length: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.CharacterVaryingType =
            PartiqlPhysical.Type.CharacterVaryingType(
                length = length?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Type.CharacterVaryingType =
            PartiqlPhysical.Type.CharacterVaryingType(
                length = length,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.MissingType].
         */
        fun missingType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.MissingType =
            PartiqlPhysical.Type.MissingType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.StringType].
         */
        fun stringType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.StringType =
            PartiqlPhysical.Type.StringType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.SymbolType].
         */
        fun symbolType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.SymbolType =
            PartiqlPhysical.Type.SymbolType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.BlobType].
         */
        fun blobType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.BlobType =
            PartiqlPhysical.Type.BlobType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.ClobType].
         */
        fun clobType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.ClobType =
            PartiqlPhysical.Type.ClobType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.DateType].
         */
        fun dateType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.DateType =
            PartiqlPhysical.Type.DateType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.TimeType].
         */
        fun timeType(
            precision: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.TimeType =
            PartiqlPhysical.Type.TimeType(
                precision = precision?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Type.TimeType =
            PartiqlPhysical.Type.TimeType(
                precision = precision,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.TimeWithTimeZoneType].
         */
        fun timeWithTimeZoneType(
            precision: Long? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.TimeWithTimeZoneType =
            PartiqlPhysical.Type.TimeWithTimeZoneType(
                precision = precision?.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Type.TimeWithTimeZoneType =
            PartiqlPhysical.Type.TimeWithTimeZoneType(
                precision = precision,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.StructType].
         */
        fun structType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.StructType =
            PartiqlPhysical.Type.StructType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.TupleType].
         */
        fun tupleType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.TupleType =
            PartiqlPhysical.Type.TupleType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.ListType].
         */
        fun listType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.ListType =
            PartiqlPhysical.Type.ListType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.SexpType].
         */
        fun sexpType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.SexpType =
            PartiqlPhysical.Type.SexpType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.BagType].
         */
        fun bagType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.BagType =
            PartiqlPhysical.Type.BagType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.AnyType].
         */
        fun anyType(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.AnyType =
            PartiqlPhysical.Type.AnyType(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Type.CustomType].
         */
        fun customType(
            name: String,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Type.CustomType =
            PartiqlPhysical.Type.CustomType(
                name = name.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Type.CustomType =
            PartiqlPhysical.Type.CustomType(
                name = name,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: StructPart 
        /**
         * Creates an instance of [PartiqlPhysical.StructPart.StructFields].
         */
        fun structFields(
            partExpr: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.StructPart.StructFields =
            PartiqlPhysical.StructPart.StructFields(
                partExpr = partExpr,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.StructPart.StructField].
         */
        fun structField(
            fieldName: Expr,
            value: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.StructPart.StructField =
            PartiqlPhysical.StructPart.StructField(
                fieldName = fieldName,
                value = value,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: Expr 
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Missing].
         */
        fun missing(
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Missing =
            PartiqlPhysical.Expr.Missing(
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Lit].
         */
        fun lit(
            value: com.amazon.ionelement.api.IonElement,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Lit =
            PartiqlPhysical.Expr.Lit(
                value = value.asAnyElement(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Parameter].
         */
        fun parameter(
            index: Long,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Parameter =
            PartiqlPhysical.Expr.Parameter(
                index = index.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Expr.Parameter =
            PartiqlPhysical.Expr.Parameter(
                index = index,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Not].
         */
        fun not(
            expr: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Not =
            PartiqlPhysical.Expr.Not(
                expr = expr,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Pos].
         */
        fun pos(
            expr: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Pos =
            PartiqlPhysical.Expr.Pos(
                expr = expr,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Neg].
         */
        fun neg(
            expr: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Neg =
            PartiqlPhysical.Expr.Neg(
                expr = expr,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Plus].
         */
        fun plus(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Plus =
            PartiqlPhysical.Expr.Plus(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Plus].
         */
        fun plus(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Plus =
            PartiqlPhysical.Expr.Plus(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Minus].
         */
        fun minus(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Minus =
            PartiqlPhysical.Expr.Minus(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Minus].
         */
        fun minus(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Minus =
            PartiqlPhysical.Expr.Minus(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Times].
         */
        fun times(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Times =
            PartiqlPhysical.Expr.Times(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Times].
         */
        fun times(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Times =
            PartiqlPhysical.Expr.Times(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Divide].
         */
        fun divide(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Divide =
            PartiqlPhysical.Expr.Divide(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Divide].
         */
        fun divide(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Divide =
            PartiqlPhysical.Expr.Divide(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Modulo].
         */
        fun modulo(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Modulo =
            PartiqlPhysical.Expr.Modulo(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Modulo].
         */
        fun modulo(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Modulo =
            PartiqlPhysical.Expr.Modulo(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Concat].
         */
        fun concat(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Concat =
            PartiqlPhysical.Expr.Concat(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Concat].
         */
        fun concat(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Concat =
            PartiqlPhysical.Expr.Concat(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.And].
         */
        fun and(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.And =
            PartiqlPhysical.Expr.And(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.And].
         */
        fun and(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.And =
            PartiqlPhysical.Expr.And(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Or].
         */
        fun or(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Or =
            PartiqlPhysical.Expr.Or(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Or].
         */
        fun or(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Or =
            PartiqlPhysical.Expr.Or(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Eq].
         */
        fun eq(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Eq =
            PartiqlPhysical.Expr.Eq(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Eq].
         */
        fun eq(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Eq =
            PartiqlPhysical.Expr.Eq(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Ne].
         */
        fun ne(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Ne =
            PartiqlPhysical.Expr.Ne(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Ne].
         */
        fun ne(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Ne =
            PartiqlPhysical.Expr.Ne(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Gt].
         */
        fun gt(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Gt =
            PartiqlPhysical.Expr.Gt(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Gt].
         */
        fun gt(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Gt =
            PartiqlPhysical.Expr.Gt(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Gte].
         */
        fun gte(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Gte =
            PartiqlPhysical.Expr.Gte(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Gte].
         */
        fun gte(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Gte =
            PartiqlPhysical.Expr.Gte(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Lt].
         */
        fun lt(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Lt =
            PartiqlPhysical.Expr.Lt(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Lt].
         */
        fun lt(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Lt =
            PartiqlPhysical.Expr.Lt(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Lte].
         */
        fun lte(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Lte =
            PartiqlPhysical.Expr.Lte(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Lte].
         */
        fun lte(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Lte =
            PartiqlPhysical.Expr.Lte(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Like].
         */
        fun like(
            value: Expr,
            pattern: Expr,
            escape: Expr? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Like =
            PartiqlPhysical.Expr.Like(
                value = value,
                pattern = pattern,
                escape = escape,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Between].
         */
        fun between(
            value: Expr,
            from: Expr,
            to: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Between =
            PartiqlPhysical.Expr.Between(
                value = value,
                from = from,
                to = to,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.InCollection].
         */
        fun inCollection(
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.InCollection =
            PartiqlPhysical.Expr.InCollection(
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.InCollection].
         */
        fun inCollection(
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.InCollection =
            PartiqlPhysical.Expr.InCollection(
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.IsType].
         */
        fun isType(
            value: Expr,
            type: Type,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.IsType =
            PartiqlPhysical.Expr.IsType(
                value = value,
                type = type,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.SimpleCase].
         */
        fun simpleCase(
            expr: Expr,
            cases: ExprPairList,
            default: Expr? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.SimpleCase =
            PartiqlPhysical.Expr.SimpleCase(
                expr = expr,
                cases = cases,
                default = default,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.SearchedCase].
         */
        fun searchedCase(
            cases: ExprPairList,
            default: Expr? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.SearchedCase =
            PartiqlPhysical.Expr.SearchedCase(
                cases = cases,
                default = default,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Bag].
         */
        fun bag(
            values: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Bag =
            PartiqlPhysical.Expr.Bag(
                values = values,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Bag].
         */
        fun bag(
            vararg values: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Bag =
            PartiqlPhysical.Expr.Bag(
                values = values.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.List].
         */
        fun list(
            values: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.List =
            PartiqlPhysical.Expr.List(
                values = values,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.List].
         */
        fun list(
            vararg values: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.List =
            PartiqlPhysical.Expr.List(
                values = values.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Sexp].
         */
        fun sexp(
            values: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Sexp =
            PartiqlPhysical.Expr.Sexp(
                values = values,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Sexp].
         */
        fun sexp(
            vararg values: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Sexp =
            PartiqlPhysical.Expr.Sexp(
                values = values.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Date].
         */
        fun date(
            year: Long,
            month: Long,
            day: Long,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Date =
            PartiqlPhysical.Expr.Date(
                year = year.asPrimitive(),
                month = month.asPrimitive(),
                day = day.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Expr.Date =
            PartiqlPhysical.Expr.Date(
                year = year,
                month = month,
                day = day,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.LitTime].
         */
        fun litTime(
            value: TimeValue,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.LitTime =
            PartiqlPhysical.Expr.LitTime(
                value = value,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.BagOp].
         */
        fun bagOp(
            op: BagOpType,
            quantifier: SetQuantifier,
            operands: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.BagOp =
            PartiqlPhysical.Expr.BagOp(
                op = op,
                quantifier = quantifier,
                operands = operands,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.BagOp].
         */
        fun bagOp(
            op: BagOpType,
            quantifier: SetQuantifier,
            operands0: Expr,
            operands1: Expr,
            vararg operands: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.BagOp =
            PartiqlPhysical.Expr.BagOp(
                op = op,
                quantifier = quantifier,
                operands = listOf(operands0, operands1) + operands.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.GraphMatch].
         */
        fun graphMatch(
            expr: Expr,
            gpmlPattern: GpmlPattern,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.GraphMatch =
            PartiqlPhysical.Expr.GraphMatch(
                expr = expr,
                gpmlPattern = gpmlPattern,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Path].
         */
        fun path(
            root: Expr,
            steps: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Path =
            PartiqlPhysical.Expr.Path(
                root = root,
                steps = steps,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Path].
         */
        fun path(
            root: Expr,
            steps0: PathStep,
            vararg steps: PathStep,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Path =
            PartiqlPhysical.Expr.Path(
                root = root,
                steps = listOf(steps0) + steps.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Call].
         */
        fun call(
            funcName: String,
            args: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Call =
            PartiqlPhysical.Expr.Call(
                funcName = funcName.asPrimitive(),
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Expr.Call =
            PartiqlPhysical.Expr.Call(
                funcName = funcName,
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Call].
         */
        fun call(
            funcName: String,
            args0: Expr,
            vararg args: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Call =
            PartiqlPhysical.Expr.Call(
                funcName = funcName?.asPrimitive(),
                args = listOf(args0) + args.toList(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Expr.Call =
            PartiqlPhysical.Expr.Call(
                funcName = funcName,
                args = listOf(args0) + args.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Cast].
         */
        fun cast(
            value: Expr,
            asType: Type,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Cast =
            PartiqlPhysical.Expr.Cast(
                value = value,
                asType = asType,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.CanCast].
         */
        fun canCast(
            value: Expr,
            asType: Type,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.CanCast =
            PartiqlPhysical.Expr.CanCast(
                value = value,
                asType = asType,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.CanLosslessCast].
         */
        fun canLosslessCast(
            value: Expr,
            asType: Type,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.CanLosslessCast =
            PartiqlPhysical.Expr.CanLosslessCast(
                value = value,
                asType = asType,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.NullIf].
         */
        fun nullIf(
            expr1: Expr,
            expr2: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.NullIf =
            PartiqlPhysical.Expr.NullIf(
                expr1 = expr1,
                expr2 = expr2,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Coalesce].
         */
        fun coalesce(
            args: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Coalesce =
            PartiqlPhysical.Expr.Coalesce(
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Coalesce].
         */
        fun coalesce(
            args0: Expr,
            vararg args: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Coalesce =
            PartiqlPhysical.Expr.Coalesce(
                args = listOf(args0) + args.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.BindingsToValues].
         */
        fun bindingsToValues(
            exp: Expr,
            query: Bexpr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.BindingsToValues =
            PartiqlPhysical.Expr.BindingsToValues(
                exp = exp,
                query = query,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Struct].
         */
        fun struct(
            parts: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Struct =
            PartiqlPhysical.Expr.Struct(
                parts = parts,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Struct].
         */
        fun struct(
            parts0: StructPart,
            vararg parts: StructPart,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Struct =
            PartiqlPhysical.Expr.Struct(
                parts = listOf(parts0) + parts.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.Pivot].
         */
        fun pivot(
            input: Bexpr,
            key: Expr,
            value: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.Pivot =
            PartiqlPhysical.Expr.Pivot(
                input = input,
                key = key,
                value = value,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.LocalId].
         */
        fun localId(
            index: Long,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.LocalId =
            PartiqlPhysical.Expr.LocalId(
                index = index.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.LocalId].
         *
         * 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 localId_(
            index: org.partiql.pig.runtime.LongPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.LocalId =
            PartiqlPhysical.Expr.LocalId(
                index = index,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.GlobalId].
         */
        fun globalId(
            uniqueId: String,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.GlobalId =
            PartiqlPhysical.Expr.GlobalId(
                uniqueId = uniqueId.asPrimitive(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Expr.GlobalId].
         *
         * 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 globalId_(
            uniqueId: org.partiql.pig.runtime.SymbolPrimitive,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Expr.GlobalId =
            PartiqlPhysical.Expr.GlobalId(
                uniqueId = uniqueId,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: Statement 
        /**
         * Creates an instance of [PartiqlPhysical.Statement.Query].
         */
        fun query(
            expr: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Statement.Query =
            PartiqlPhysical.Statement.Query(
                expr = expr,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Statement.Exec].
         */
        fun exec(
            procedureName: String,
            args: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Statement.Exec =
            PartiqlPhysical.Statement.Exec(
                procedureName = procedureName.asPrimitive(),
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Statement.Exec =
            PartiqlPhysical.Statement.Exec(
                procedureName = procedureName,
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Statement.Exec].
         */
        fun exec(
            procedureName: String,
            vararg args: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Statement.Exec =
            PartiqlPhysical.Statement.Exec(
                procedureName = procedureName?.asPrimitive(),
                args = args.toList(),
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.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()
        ): PartiqlPhysical.Statement.Exec =
            PartiqlPhysical.Statement.Exec(
                procedureName = procedureName,
                args = args.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Statement.Explain].
         */
        fun explain(
            target: ExplainTarget,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Statement.Explain =
            PartiqlPhysical.Statement.Explain(
                target = target,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Statement.DmlQuery].
         */
        fun dmlQuery(
            expr: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Statement.DmlQuery =
            PartiqlPhysical.Statement.DmlQuery(
                expr = expr,
                metas = newMetaContainer() + metas
            )
        
        
        // Variants for Sum: Bexpr 
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Project].
         */
        fun project(
            i: Impl,
            binding: VarDecl,
            args: kotlin.collections.List = emptyList(),
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Project =
            PartiqlPhysical.Bexpr.Project(
                i = i,
                binding = binding,
                args = args,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Project].
         */
        fun project(
            i: Impl,
            binding: VarDecl,
            vararg args: Expr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Project =
            PartiqlPhysical.Bexpr.Project(
                i = i,
                binding = binding,
                args = args.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Scan].
         */
        fun scan(
            i: Impl,
            expr: Expr,
            asDecl: VarDecl,
            atDecl: VarDecl? = null,
            byDecl: VarDecl? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Scan =
            PartiqlPhysical.Bexpr.Scan(
                i = i,
                expr = expr,
                asDecl = asDecl,
                atDecl = atDecl,
                byDecl = byDecl,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Unpivot].
         */
        fun unpivot(
            i: Impl,
            expr: Expr,
            asDecl: VarDecl,
            atDecl: VarDecl? = null,
            byDecl: VarDecl? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Unpivot =
            PartiqlPhysical.Bexpr.Unpivot(
                i = i,
                expr = expr,
                asDecl = asDecl,
                atDecl = atDecl,
                byDecl = byDecl,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Filter].
         */
        fun filter(
            i: Impl,
            predicate: Expr,
            source: Bexpr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Filter =
            PartiqlPhysical.Bexpr.Filter(
                i = i,
                predicate = predicate,
                source = source,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Join].
         */
        fun join(
            i: Impl,
            joinType: JoinType,
            left: Bexpr,
            right: Bexpr,
            predicate: Expr? = null,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Join =
            PartiqlPhysical.Bexpr.Join(
                i = i,
                joinType = joinType,
                left = left,
                right = right,
                predicate = predicate,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Sort].
         */
        fun sort(
            i: Impl,
            source: Bexpr,
            sortSpecs: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Sort =
            PartiqlPhysical.Bexpr.Sort(
                i = i,
                source = source,
                sortSpecs = sortSpecs,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Sort].
         */
        fun sort(
            i: Impl,
            source: Bexpr,
            sortSpecs0: SortSpec,
            vararg sortSpecs: SortSpec,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Sort =
            PartiqlPhysical.Bexpr.Sort(
                i = i,
                source = source,
                sortSpecs = listOf(sortSpecs0) + sortSpecs.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Aggregate].
         */
        fun aggregate(
            i: Impl,
            source: Bexpr,
            strategy: GroupingStrategy,
            groupList: GroupKeyList,
            functionList: AggregateFunctionList,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Aggregate =
            PartiqlPhysical.Bexpr.Aggregate(
                i = i,
                source = source,
                strategy = strategy,
                groupList = groupList,
                functionList = functionList,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Offset].
         */
        fun offset(
            i: Impl,
            rowCount: Expr,
            source: Bexpr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Offset =
            PartiqlPhysical.Bexpr.Offset(
                i = i,
                rowCount = rowCount,
                source = source,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Limit].
         */
        fun limit(
            i: Impl,
            rowCount: Expr,
            source: Bexpr,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Limit =
            PartiqlPhysical.Bexpr.Limit(
                i = i,
                rowCount = rowCount,
                source = source,
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Let].
         */
        fun let(
            i: Impl,
            source: Bexpr,
            bindings: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Let =
            PartiqlPhysical.Bexpr.Let(
                i = i,
                source = source,
                bindings = bindings,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Let].
         */
        fun let(
            i: Impl,
            source: Bexpr,
            bindings0: LetBinding,
            vararg bindings: LetBinding,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Let =
            PartiqlPhysical.Bexpr.Let(
                i = i,
                source = source,
                bindings = listOf(bindings0) + bindings.toList(),
                metas = newMetaContainer() + metas
            )
        
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Window].
         */
        fun window(
            i: Impl,
            source: Bexpr,
            windowSpecification: Over,
            windowExpressionList: kotlin.collections.List,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Window =
            PartiqlPhysical.Bexpr.Window(
                i = i,
                source = source,
                windowSpecification = windowSpecification,
                windowExpressionList = windowExpressionList,
                metas = newMetaContainer() + metas
            )
        
        /**
         * Creates an instance of [PartiqlPhysical.Bexpr.Window].
         */
        fun window(
            i: Impl,
            source: Bexpr,
            windowSpecification: Over,
            windowExpressionList0: WindowExpression,
            vararg windowExpressionList: WindowExpression,
            metas: MetaContainer = emptyMetaContainer()
        ): PartiqlPhysical.Bexpr.Window =
            PartiqlPhysical.Bexpr.Window(
                i = i,
                source = source,
                windowSpecification = windowSpecification,
                windowExpressionList = listOf(windowExpressionList0) + windowExpressionList.toList(),
                metas = newMetaContainer() + metas
            )
    }
    
    /** Default implementation of [Builder] that uses all default method implementations. */
    private object PartiqlPhysicalBuilder : Builder
    
    /** Base class for all PartiqlPhysical types. */
    abstract class PartiqlPhysicalNode : DomainNode {
        abstract override fun copy(metas: MetaContainer): PartiqlPhysicalNode
        override fun toString() = toIonElement().toString()
        abstract override fun withMeta(metaKey: String, metaValue: Any): PartiqlPhysicalNode
        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()
    ): PartiqlPhysicalNode() {
    
        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 GraphMatchQuantifier(
        val lower: org.partiql.pig.runtime.LongPrimitive,
        val upper: org.partiql.pig.runtime.LongPrimitive?,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlPhysicalNode() {
    
        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()
    ): PartiqlPhysicalNode() {
    
        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()
    ): PartiqlPhysicalNode() {
    
        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()
    ): PartiqlPhysicalNode() {
    
        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()
    ): PartiqlPhysicalNode() {
    
        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 SortSpec(
        val expr: Expr,
        val orderingSpec: OrderingSpec?,
        val nullsSpec: NullsSpec?,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlPhysicalNode() {
    
        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()
    ): PartiqlPhysicalNode() {
    
        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()
    ): PartiqlPhysicalNode() {
    
        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()
    ): PartiqlPhysicalNode() {
    
        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 Identifier(
        val name: org.partiql.pig.runtime.SymbolPrimitive,
        val case: CaseSensitivity,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlPhysicalNode() {
    
        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 LetBinding(
        val value: Expr,
        val decl: VarDecl,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlPhysicalNode() {
    
        override fun copy(metas: MetaContainer): LetBinding =
            LetBinding(
                value = value,
                decl = decl,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): LetBinding =
            LetBinding(
                value = value,
                decl = decl,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("let_binding"),
                value.toIonElement(),
                decl.toIonElement(),
                metas = metas)
            return elements
        }
    
        fun copy(
            value: Expr = this.value,
            decl: VarDecl = this.decl,
            metas: MetaContainer = this.metas
        ) =
            LetBinding(
                value,
                decl,
                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 (value != other.value) return false
            if (decl != other.decl) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = value.hashCode()
            hc = 31 * hc + decl.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class GroupKey(
        val expr: Expr,
        val asVar: VarDecl,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlPhysicalNode() {
    
        override fun copy(metas: MetaContainer): GroupKey =
            GroupKey(
                expr = expr,
                asVar = asVar,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): GroupKey =
            GroupKey(
                expr = expr,
                asVar = asVar,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("group_key"),
                expr.toIonElement(),
                asVar.toIonElement(),
                metas = metas)
            return elements
        }
    
        fun copy(
            expr: Expr = this.expr,
            asVar: VarDecl = this.asVar,
            metas: MetaContainer = this.metas
        ) =
            GroupKey(
                expr,
                asVar,
                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 (asVar != other.asVar) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = expr.hashCode()
            hc = 31 * hc + asVar.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class GroupKeyList(
        val keys: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlPhysicalNode() {
    
        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 AggregateFunction(
        val quantifier: SetQuantifier,
        val name: org.partiql.pig.runtime.SymbolPrimitive,
        val arg: Expr,
        val asVar: VarDecl,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlPhysicalNode() {
    
        override fun copy(metas: MetaContainer): AggregateFunction =
            AggregateFunction(
                quantifier = quantifier,
                name = name,
                arg = arg,
                asVar = asVar,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): AggregateFunction =
            AggregateFunction(
                quantifier = quantifier,
                name = name,
                arg = arg,
                asVar = asVar,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("aggregate_function"),
                quantifier.toIonElement(),
                name.toIonElement(),
                arg.toIonElement(),
                asVar.toIonElement(),
                metas = metas)
            return elements
        }
    
        fun copy(
            quantifier: SetQuantifier = this.quantifier,
            name: org.partiql.pig.runtime.SymbolPrimitive = this.name,
            arg: Expr = this.arg,
            asVar: VarDecl = this.asVar,
            metas: MetaContainer = this.metas
        ) =
            AggregateFunction(
                quantifier,
                name,
                arg,
                asVar,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != AggregateFunction::class.java) return false
    
            other as AggregateFunction
            if (quantifier != other.quantifier) return false
            if (name != other.name) return false
            if (arg != other.arg) return false
            if (asVar != other.asVar) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = quantifier.hashCode()
            hc = 31 * hc + name.hashCode()
            hc = 31 * hc + arg.hashCode()
            hc = 31 * hc + asVar.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class AggregateFunctionList(
        val functions: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlPhysicalNode() {
    
        override fun copy(metas: MetaContainer): AggregateFunctionList =
            AggregateFunctionList(
                functions = functions,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): AggregateFunctionList =
            AggregateFunctionList(
                functions = functions,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("aggregate_function_list"),
                *functions.map { it.toIonElement() }.toTypedArray(),
                metas = metas)
            return elements
        }
    
        fun copy(
            functions: kotlin.collections.List = this.functions,
            metas: MetaContainer = this.metas
        ) =
            AggregateFunctionList(
                functions,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != AggregateFunctionList::class.java) return false
    
            other as AggregateFunctionList
            if (functions != other.functions) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = functions.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class WindowExpression(
        val decl: VarDecl,
        val funcName: org.partiql.pig.runtime.SymbolPrimitive,
        val args: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlPhysicalNode() {
    
        override fun copy(metas: MetaContainer): WindowExpression =
            WindowExpression(
                decl = decl,
                funcName = funcName,
                args = args,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): WindowExpression =
            WindowExpression(
                decl = decl,
                funcName = funcName,
                args = args,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("window_expression"),
                decl.toIonElement(),
                funcName.toIonElement(),
                *args.map { it.toIonElement() }.toTypedArray(),
                metas = metas)
            return elements
        }
    
        fun copy(
            decl: VarDecl = this.decl,
            funcName: org.partiql.pig.runtime.SymbolPrimitive = this.funcName,
            args: kotlin.collections.List = this.args,
            metas: MetaContainer = this.metas
        ) =
            WindowExpression(
                decl,
                funcName,
                args,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != WindowExpression::class.java) return false
    
            other as WindowExpression
            if (decl != other.decl) return false
            if (funcName != other.funcName) return false
            if (args != other.args) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = decl.hashCode()
            hc = 31 * hc + funcName.hashCode()
            hc = 31 * hc + args.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class Plan(
        val stmt: Statement,
        val version: org.partiql.pig.runtime.SymbolPrimitive,
        val locals: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlPhysicalNode() {
    
        override fun copy(metas: MetaContainer): Plan =
            Plan(
                stmt = stmt,
                version = version,
                locals = locals,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): Plan =
            Plan(
                stmt = stmt,
                version = version,
                locals = locals,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = listOfNotNull(
                ionSymbol("plan"),
                stmt?.let { ionSexpOf(ionSymbol("stmt"), it.toIonElement()) },
                version?.let { ionSexpOf(ionSymbol("version"), it.toIonElement()) },
                if(locals.any()) { ionSexpOf(ionSymbol("locals"), *locals.map { it.toIonElement() }.toTypedArray()) } else { null }
            )
    
            return ionSexpOf(elements, metas = metas)
        }
    
        fun copy(
            stmt: Statement = this.stmt,
            version: org.partiql.pig.runtime.SymbolPrimitive = this.version,
            locals: kotlin.collections.List = this.locals,
            metas: MetaContainer = this.metas
        ) =
            Plan(
                stmt,
                version,
                locals,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != Plan::class.java) return false
    
            other as Plan
            if (stmt != other.stmt) return false
            if (version != other.version) return false
            if (locals != other.locals) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = stmt.hashCode()
            hc = 31 * hc + version.hashCode()
            hc = 31 * hc + locals.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class LocalVariable(
        val name: org.partiql.pig.runtime.SymbolPrimitive,
        val registerIndex: org.partiql.pig.runtime.LongPrimitive,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlPhysicalNode() {
    
        override fun copy(metas: MetaContainer): LocalVariable =
            LocalVariable(
                name = name,
                registerIndex = registerIndex,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): LocalVariable =
            LocalVariable(
                name = name,
                registerIndex = registerIndex,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("local_variable"),
                name.toIonElement(),
                registerIndex.toIonElement(),
                metas = metas)
            return elements
        }
    
        fun copy(
            name: org.partiql.pig.runtime.SymbolPrimitive = this.name,
            registerIndex: org.partiql.pig.runtime.LongPrimitive = this.registerIndex,
            metas: MetaContainer = this.metas
        ) =
            LocalVariable(
                name,
                registerIndex,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != LocalVariable::class.java) return false
    
            other as LocalVariable
            if (name != other.name) return false
            if (registerIndex != other.registerIndex) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = name.hashCode()
            hc = 31 * hc + registerIndex.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    class VarDecl(
        val index: org.partiql.pig.runtime.LongPrimitive,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlPhysicalNode() {
    
        override fun copy(metas: MetaContainer): VarDecl =
            VarDecl(
                index = index,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): VarDecl =
            VarDecl(
                index = index,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("var_decl"),
                index.toIonElement(),
                metas = metas)
            return elements
        }
    
        fun copy(
            index: org.partiql.pig.runtime.LongPrimitive = this.index,
            metas: MetaContainer = this.metas
        ) =
            VarDecl(
                index,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != VarDecl::class.java) return false
    
            other as VarDecl
            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 Impl(
        val name: org.partiql.pig.runtime.SymbolPrimitive,
        val staticArgs: kotlin.collections.List,
        override val metas: MetaContainer = emptyMetaContainer()
    ): PartiqlPhysicalNode() {
    
        override fun copy(metas: MetaContainer): Impl =
            Impl(
                name = name,
                staticArgs = staticArgs,
                metas = metas)
    
        override fun withMeta(metaKey: String, metaValue: Any): Impl =
            Impl(
                name = name,
                staticArgs = staticArgs,
                metas = metas + metaContainerOf(metaKey to metaValue))
    
        override fun toIonElement(): SexpElement {
            val elements = ionSexpOf(
                ionSymbol("impl"),
                name.toIonElement(),
                *staticArgs.map { it.toIonElement() }.toTypedArray(),
                metas = metas)
            return elements
        }
    
        fun copy(
            name: org.partiql.pig.runtime.SymbolPrimitive = this.name,
            staticArgs: kotlin.collections.List = this.staticArgs,
            metas: MetaContainer = this.metas
        ) =
            Impl(
                name,
                staticArgs,
                metas)
    
        override fun equals(other: Any?): Boolean {
            if (other == null) return false
            if (this === other) return true
            if (other.javaClass != Impl::class.java) return false
    
            other as Impl
            if (name != other.name) return false
            if (staticArgs != other.staticArgs) return false
            return true
        }
    
        private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
            var hc = name.hashCode()
            hc = 31 * hc + staticArgs.hashCode()
            hc
        }
    
        override fun hashCode(): Int = myHashCode
    }
    
    
    /////////////////////////////////////////////////////////////////////////////
    // Sum Types
    /////////////////////////////////////////////////////////////////////////////
    
    sealed class ExplainTarget(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 [PartiqlPhysical.ExplainTarget] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.ExplainTarget): T = when(node) {
                is PartiqlPhysical.ExplainTarget.Domain -> convertDomain(node)
            }
    
            fun convertDomain(node: PartiqlPhysical.ExplainTarget.Domain): T
        }
    }
    
    sealed class PathStep(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 = 2001
        }
    
        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 = 2002
        }
    
        /** Converts instances of [PartiqlPhysical.PathStep] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.PathStep): T = when(node) {
                is PartiqlPhysical.PathStep.PathExpr -> convertPathExpr(node)
                is PartiqlPhysical.PathStep.PathWildcard -> convertPathWildcard(node)
                is PartiqlPhysical.PathStep.PathUnpivot -> convertPathUnpivot(node)
            }
    
            fun convertPathExpr(node: PartiqlPhysical.PathStep.PathExpr): T
            fun convertPathWildcard(node: PartiqlPhysical.PathStep.PathWildcard): T
            fun convertPathUnpivot(node: PartiqlPhysical.PathStep.PathUnpivot): T
        }
    }
    
    sealed class JoinType(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 = 3000
        }
    
        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 = 3001
        }
    
        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 = 3002
        }
    
        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 = 3003
        }
    
        /** Converts instances of [PartiqlPhysical.JoinType] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.JoinType): T = when(node) {
                is PartiqlPhysical.JoinType.Inner -> convertInner(node)
                is PartiqlPhysical.JoinType.Left -> convertLeft(node)
                is PartiqlPhysical.JoinType.Right -> convertRight(node)
                is PartiqlPhysical.JoinType.Full -> convertFull(node)
            }
    
            fun convertInner(node: PartiqlPhysical.JoinType.Inner): T
            fun convertLeft(node: PartiqlPhysical.JoinType.Left): T
            fun convertRight(node: PartiqlPhysical.JoinType.Right): T
            fun convertFull(node: PartiqlPhysical.JoinType.Full): T
        }
    }
    
    sealed class GraphMatchDirection(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 = 4000
        }
    
        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 = 4001
        }
    
        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 = 4002
        }
    
        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 = 4003
        }
    
        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 = 4004
        }
    
        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 = 4005
        }
    
        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 = 4006
        }
    
        /** Converts instances of [PartiqlPhysical.GraphMatchDirection] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.GraphMatchDirection): T = when(node) {
                is PartiqlPhysical.GraphMatchDirection.EdgeLeft -> convertEdgeLeft(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeUndirected -> convertEdgeUndirected(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeRight -> convertEdgeRight(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected -> convertEdgeLeftOrUndirected(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight -> convertEdgeUndirectedOrRight(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight -> convertEdgeLeftOrRight(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight -> convertEdgeLeftOrUndirectedOrRight(node)
            }
    
            fun convertEdgeLeft(node: PartiqlPhysical.GraphMatchDirection.EdgeLeft): T
            fun convertEdgeUndirected(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirected): T
            fun convertEdgeRight(node: PartiqlPhysical.GraphMatchDirection.EdgeRight): T
            fun convertEdgeLeftOrUndirected(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected): T
            fun convertEdgeUndirectedOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight): T
            fun convertEdgeLeftOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight): T
            fun convertEdgeLeftOrUndirectedOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight): T
        }
    }
    
    sealed class GraphMatchPatternPart(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 [PartiqlPhysical.GraphMatchPatternPart] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.GraphMatchPatternPart): T = when(node) {
                is PartiqlPhysical.GraphMatchPatternPart.Node -> convertNode(node)
                is PartiqlPhysical.GraphMatchPatternPart.Edge -> convertEdge(node)
                is PartiqlPhysical.GraphMatchPatternPart.Pattern -> convertPattern(node)
            }
    
            fun convertNode(node: PartiqlPhysical.GraphMatchPatternPart.Node): T
            fun convertEdge(node: PartiqlPhysical.GraphMatchPatternPart.Edge): T
            fun convertPattern(node: PartiqlPhysical.GraphMatchPatternPart.Pattern): T
        }
    }
    
    sealed class GraphMatchRestrictor(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 = 6000
        }
    
        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 = 6001
        }
    
        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 = 6002
        }
    
        /** Converts instances of [PartiqlPhysical.GraphMatchRestrictor] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.GraphMatchRestrictor): T = when(node) {
                is PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail -> convertRestrictorTrail(node)
                is PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic -> convertRestrictorAcyclic(node)
                is PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple -> convertRestrictorSimple(node)
            }
    
            fun convertRestrictorTrail(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail): T
            fun convertRestrictorAcyclic(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic): T
            fun convertRestrictorSimple(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple): T
        }
    }
    
    sealed class GraphMatchSelector(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 = 7000
        }
    
        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 = 7001
        }
    
        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 = 7002
        }
    
        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 [PartiqlPhysical.GraphMatchSelector] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.GraphMatchSelector): T = when(node) {
                is PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest -> convertSelectorAnyShortest(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorAllShortest -> convertSelectorAllShortest(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorAny -> convertSelectorAny(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorAnyK -> convertSelectorAnyK(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorShortestK -> convertSelectorShortestK(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup -> convertSelectorShortestKGroup(node)
            }
    
            fun convertSelectorAnyShortest(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest): T
            fun convertSelectorAllShortest(node: PartiqlPhysical.GraphMatchSelector.SelectorAllShortest): T
            fun convertSelectorAny(node: PartiqlPhysical.GraphMatchSelector.SelectorAny): T
            fun convertSelectorAnyK(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyK): T
            fun convertSelectorShortestK(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestK): T
            fun convertSelectorShortestKGroup(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup): T
        }
    }
    
    sealed class GroupingStrategy(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 = 8000
        }
    
        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 = 8001
        }
    
        /** Converts instances of [PartiqlPhysical.GroupingStrategy] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.GroupingStrategy): T = when(node) {
                is PartiqlPhysical.GroupingStrategy.GroupFull -> convertGroupFull(node)
                is PartiqlPhysical.GroupingStrategy.GroupPartial -> convertGroupPartial(node)
            }
    
            fun convertGroupFull(node: PartiqlPhysical.GroupingStrategy.GroupFull): T
            fun convertGroupPartial(node: PartiqlPhysical.GroupingStrategy.GroupPartial): T
        }
    }
    
    sealed class OrderingSpec(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 = 9000
        }
    
        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 = 9001
        }
    
        /** Converts instances of [PartiqlPhysical.OrderingSpec] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.OrderingSpec): T = when(node) {
                is PartiqlPhysical.OrderingSpec.Asc -> convertAsc(node)
                is PartiqlPhysical.OrderingSpec.Desc -> convertDesc(node)
            }
    
            fun convertAsc(node: PartiqlPhysical.OrderingSpec.Asc): T
            fun convertDesc(node: PartiqlPhysical.OrderingSpec.Desc): T
        }
    }
    
    sealed class NullsSpec(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 = 10000
        }
    
        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 = 10001
        }
    
        /** Converts instances of [PartiqlPhysical.NullsSpec] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.NullsSpec): T = when(node) {
                is PartiqlPhysical.NullsSpec.NullsFirst -> convertNullsFirst(node)
                is PartiqlPhysical.NullsSpec.NullsLast -> convertNullsLast(node)
            }
    
            fun convertNullsFirst(node: PartiqlPhysical.NullsSpec.NullsFirst): T
            fun convertNullsLast(node: PartiqlPhysical.NullsSpec.NullsLast): T
        }
    }
    
    sealed class CaseSensitivity(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 = 11000
        }
    
        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 = 11001
        }
    
        /** Converts instances of [PartiqlPhysical.CaseSensitivity] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.CaseSensitivity): T = when(node) {
                is PartiqlPhysical.CaseSensitivity.CaseSensitive -> convertCaseSensitive(node)
                is PartiqlPhysical.CaseSensitivity.CaseInsensitive -> convertCaseInsensitive(node)
            }
    
            fun convertCaseSensitive(node: PartiqlPhysical.CaseSensitivity.CaseSensitive): T
            fun convertCaseInsensitive(node: PartiqlPhysical.CaseSensitivity.CaseInsensitive): T
        }
    }
    
    sealed class SetQuantifier(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 = 12000
        }
    
        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 = 12001
        }
    
        /** Converts instances of [PartiqlPhysical.SetQuantifier] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.SetQuantifier): T = when(node) {
                is PartiqlPhysical.SetQuantifier.All -> convertAll(node)
                is PartiqlPhysical.SetQuantifier.Distinct -> convertDistinct(node)
            }
    
            fun convertAll(node: PartiqlPhysical.SetQuantifier.All): T
            fun convertDistinct(node: PartiqlPhysical.SetQuantifier.Distinct): T
        }
    }
    
    sealed class BagOpType(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 = 13000
        }
    
        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 = 13001
        }
    
        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 = 13002
        }
    
        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 = 13003
        }
    
        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 = 13004
        }
    
        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 = 13005
        }
    
        /** Converts instances of [PartiqlPhysical.BagOpType] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.BagOpType): T = when(node) {
                is PartiqlPhysical.BagOpType.Union -> convertUnion(node)
                is PartiqlPhysical.BagOpType.Intersect -> convertIntersect(node)
                is PartiqlPhysical.BagOpType.Except -> convertExcept(node)
                is PartiqlPhysical.BagOpType.OuterUnion -> convertOuterUnion(node)
                is PartiqlPhysical.BagOpType.OuterIntersect -> convertOuterIntersect(node)
                is PartiqlPhysical.BagOpType.OuterExcept -> convertOuterExcept(node)
            }
    
            fun convertUnion(node: PartiqlPhysical.BagOpType.Union): T
            fun convertIntersect(node: PartiqlPhysical.BagOpType.Intersect): T
            fun convertExcept(node: PartiqlPhysical.BagOpType.Except): T
            fun convertOuterUnion(node: PartiqlPhysical.BagOpType.OuterUnion): T
            fun convertOuterIntersect(node: PartiqlPhysical.BagOpType.OuterIntersect): T
            fun convertOuterExcept(node: PartiqlPhysical.BagOpType.OuterExcept): T
        }
    }
    
    sealed class OnConflictValue(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 = 14000
        }
    
        /** Converts instances of [PartiqlPhysical.OnConflictValue] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.OnConflictValue): T = when(node) {
                is PartiqlPhysical.OnConflictValue.Excluded -> convertExcluded(node)
            }
    
            fun convertExcluded(node: PartiqlPhysical.OnConflictValue.Excluded): T
        }
    }
    
    sealed class Type(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        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 = 15000
        }
    
        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 = 15001
        }
    
        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 = 15002
        }
    
        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 = 15003
        }
    
        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 = 15004
        }
    
        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 = 15005
        }
    
        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 = 15007
        }
    
        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 = 15008
        }
    
        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 = 15011
        }
    
        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 = 15014
        }
    
        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 = 15015
        }
    
        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 = 15016
        }
    
        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 = 15017
        }
    
        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 = 15018
        }
    
        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 = 15019
        }
    
        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 = 15022
        }
    
        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 = 15023
        }
    
        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 = 15024
        }
    
        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 = 15025
        }
    
        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 = 15026
        }
    
        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 = 15027
        }
    
        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 [PartiqlPhysical.Type] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.Type): T = when(node) {
                is PartiqlPhysical.Type.NullType -> convertNullType(node)
                is PartiqlPhysical.Type.BooleanType -> convertBooleanType(node)
                is PartiqlPhysical.Type.SmallintType -> convertSmallintType(node)
                is PartiqlPhysical.Type.Integer4Type -> convertInteger4Type(node)
                is PartiqlPhysical.Type.Integer8Type -> convertInteger8Type(node)
                is PartiqlPhysical.Type.IntegerType -> convertIntegerType(node)
                is PartiqlPhysical.Type.FloatType -> convertFloatType(node)
                is PartiqlPhysical.Type.RealType -> convertRealType(node)
                is PartiqlPhysical.Type.DoublePrecisionType -> convertDoublePrecisionType(node)
                is PartiqlPhysical.Type.DecimalType -> convertDecimalType(node)
                is PartiqlPhysical.Type.NumericType -> convertNumericType(node)
                is PartiqlPhysical.Type.TimestampType -> convertTimestampType(node)
                is PartiqlPhysical.Type.CharacterType -> convertCharacterType(node)
                is PartiqlPhysical.Type.CharacterVaryingType -> convertCharacterVaryingType(node)
                is PartiqlPhysical.Type.MissingType -> convertMissingType(node)
                is PartiqlPhysical.Type.StringType -> convertStringType(node)
                is PartiqlPhysical.Type.SymbolType -> convertSymbolType(node)
                is PartiqlPhysical.Type.BlobType -> convertBlobType(node)
                is PartiqlPhysical.Type.ClobType -> convertClobType(node)
                is PartiqlPhysical.Type.DateType -> convertDateType(node)
                is PartiqlPhysical.Type.TimeType -> convertTimeType(node)
                is PartiqlPhysical.Type.TimeWithTimeZoneType -> convertTimeWithTimeZoneType(node)
                is PartiqlPhysical.Type.StructType -> convertStructType(node)
                is PartiqlPhysical.Type.TupleType -> convertTupleType(node)
                is PartiqlPhysical.Type.ListType -> convertListType(node)
                is PartiqlPhysical.Type.SexpType -> convertSexpType(node)
                is PartiqlPhysical.Type.BagType -> convertBagType(node)
                is PartiqlPhysical.Type.AnyType -> convertAnyType(node)
                is PartiqlPhysical.Type.CustomType -> convertCustomType(node)
            }
    
            fun convertNullType(node: PartiqlPhysical.Type.NullType): T
            fun convertBooleanType(node: PartiqlPhysical.Type.BooleanType): T
            fun convertSmallintType(node: PartiqlPhysical.Type.SmallintType): T
            fun convertInteger4Type(node: PartiqlPhysical.Type.Integer4Type): T
            fun convertInteger8Type(node: PartiqlPhysical.Type.Integer8Type): T
            fun convertIntegerType(node: PartiqlPhysical.Type.IntegerType): T
            fun convertFloatType(node: PartiqlPhysical.Type.FloatType): T
            fun convertRealType(node: PartiqlPhysical.Type.RealType): T
            fun convertDoublePrecisionType(node: PartiqlPhysical.Type.DoublePrecisionType): T
            fun convertDecimalType(node: PartiqlPhysical.Type.DecimalType): T
            fun convertNumericType(node: PartiqlPhysical.Type.NumericType): T
            fun convertTimestampType(node: PartiqlPhysical.Type.TimestampType): T
            fun convertCharacterType(node: PartiqlPhysical.Type.CharacterType): T
            fun convertCharacterVaryingType(node: PartiqlPhysical.Type.CharacterVaryingType): T
            fun convertMissingType(node: PartiqlPhysical.Type.MissingType): T
            fun convertStringType(node: PartiqlPhysical.Type.StringType): T
            fun convertSymbolType(node: PartiqlPhysical.Type.SymbolType): T
            fun convertBlobType(node: PartiqlPhysical.Type.BlobType): T
            fun convertClobType(node: PartiqlPhysical.Type.ClobType): T
            fun convertDateType(node: PartiqlPhysical.Type.DateType): T
            fun convertTimeType(node: PartiqlPhysical.Type.TimeType): T
            fun convertTimeWithTimeZoneType(node: PartiqlPhysical.Type.TimeWithTimeZoneType): T
            fun convertStructType(node: PartiqlPhysical.Type.StructType): T
            fun convertTupleType(node: PartiqlPhysical.Type.TupleType): T
            fun convertListType(node: PartiqlPhysical.Type.ListType): T
            fun convertSexpType(node: PartiqlPhysical.Type.SexpType): T
            fun convertBagType(node: PartiqlPhysical.Type.BagType): T
            fun convertAnyType(node: PartiqlPhysical.Type.AnyType): T
            fun convertCustomType(node: PartiqlPhysical.Type.CustomType): T
        }
    }
    
    sealed class StructPart(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        override fun copy(metas: MetaContainer): StructPart =
            when (this) {
                is StructFields -> copy(metas = metas)
                is StructField -> copy(metas = metas)
            }
    
        class StructFields(
            val partExpr: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): StructPart() {
        
            override fun copy(metas: MetaContainer): StructFields =
                StructFields(
                    partExpr = partExpr,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): StructFields =
                StructFields(
                    partExpr = partExpr,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("struct_fields"),
                    partExpr.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                partExpr: Expr = this.partExpr,
                metas: MetaContainer = this.metas
            ) =
                StructFields(
                    partExpr,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != StructFields::class.java) return false
        
                other as StructFields
                if (partExpr != other.partExpr) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = partExpr.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class StructField(
            val fieldName: Expr,
            val value: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): StructPart() {
        
            override fun copy(metas: MetaContainer): StructField =
                StructField(
                    fieldName = fieldName,
                    value = value,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): StructField =
                StructField(
                    fieldName = fieldName,
                    value = value,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("struct_field"),
                    fieldName.toIonElement(),
                    value.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                fieldName: Expr = this.fieldName,
                value: Expr = this.value,
                metas: MetaContainer = this.metas
            ) =
                StructField(
                    fieldName,
                    value,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != StructField::class.java) return false
        
                other as StructField
                if (fieldName != other.fieldName) return false
                if (value != other.value) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = fieldName.hashCode()
                hc = 31 * hc + value.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlPhysical.StructPart] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.StructPart): T = when(node) {
                is PartiqlPhysical.StructPart.StructFields -> convertStructFields(node)
                is PartiqlPhysical.StructPart.StructField -> convertStructField(node)
            }
    
            fun convertStructFields(node: PartiqlPhysical.StructPart.StructFields): T
            fun convertStructField(node: PartiqlPhysical.StructPart.StructField): T
        }
    }
    
    sealed class Expr(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        override fun copy(metas: MetaContainer): Expr =
            when (this) {
                is Missing -> copy(metas = metas)
                is Lit -> 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 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 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 BindingsToValues -> copy(metas = metas)
                is Struct -> copy(metas = metas)
                is Pivot -> copy(metas = metas)
                is LocalId -> copy(metas = metas)
                is GlobalId -> 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 = 17000
        }
    
        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 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 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 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 BindingsToValues(
            val exp: Expr,
            val query: Bexpr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): BindingsToValues =
                BindingsToValues(
                    exp = exp,
                    query = query,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): BindingsToValues =
                BindingsToValues(
                    exp = exp,
                    query = query,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("bindings_to_values"),
                    exp.toIonElement(),
                    query.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                exp: Expr = this.exp,
                query: Bexpr = this.query,
                metas: MetaContainer = this.metas
            ) =
                BindingsToValues(
                    exp,
                    query,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != BindingsToValues::class.java) return false
        
                other as BindingsToValues
                if (exp != other.exp) return false
                if (query != other.query) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = exp.hashCode()
                hc = 31 * hc + query.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Struct(
            val parts: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Struct =
                Struct(
                    parts = parts,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Struct =
                Struct(
                    parts = parts,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("struct"),
                    *parts.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                parts: kotlin.collections.List = this.parts,
                metas: MetaContainer = this.metas
            ) =
                Struct(
                    parts,
                    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 (parts != other.parts) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = parts.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Pivot(
            val input: Bexpr,
            val key: Expr,
            val value: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): Pivot =
                Pivot(
                    input = input,
                    key = key,
                    value = value,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Pivot =
                Pivot(
                    input = input,
                    key = key,
                    value = value,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("pivot"),
                    input.toIonElement(),
                    key.toIonElement(),
                    value.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                input: Bexpr = this.input,
                key: Expr = this.key,
                value: Expr = this.value,
                metas: MetaContainer = this.metas
            ) =
                Pivot(
                    input,
                    key,
                    value,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Pivot::class.java) return false
        
                other as Pivot
                if (input != other.input) return false
                if (key != other.key) return false
                if (value != other.value) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = input.hashCode()
                hc = 31 * hc + key.hashCode()
                hc = 31 * hc + value.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class LocalId(
            val index: org.partiql.pig.runtime.LongPrimitive,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): LocalId =
                LocalId(
                    index = index,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): LocalId =
                LocalId(
                    index = index,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("local_id"),
                    index.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                index: org.partiql.pig.runtime.LongPrimitive = this.index,
                metas: MetaContainer = this.metas
            ) =
                LocalId(
                    index,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != LocalId::class.java) return false
        
                other as LocalId
                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 GlobalId(
            val uniqueId: org.partiql.pig.runtime.SymbolPrimitive,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Expr() {
        
            override fun copy(metas: MetaContainer): GlobalId =
                GlobalId(
                    uniqueId = uniqueId,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): GlobalId =
                GlobalId(
                    uniqueId = uniqueId,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("global_id"),
                    uniqueId.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                uniqueId: org.partiql.pig.runtime.SymbolPrimitive = this.uniqueId,
                metas: MetaContainer = this.metas
            ) =
                GlobalId(
                    uniqueId,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != GlobalId::class.java) return false
        
                other as GlobalId
                if (uniqueId != other.uniqueId) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = uniqueId.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlPhysical.Expr] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.Expr): T = when(node) {
                is PartiqlPhysical.Expr.Missing -> convertMissing(node)
                is PartiqlPhysical.Expr.Lit -> convertLit(node)
                is PartiqlPhysical.Expr.Parameter -> convertParameter(node)
                is PartiqlPhysical.Expr.Not -> convertNot(node)
                is PartiqlPhysical.Expr.Pos -> convertPos(node)
                is PartiqlPhysical.Expr.Neg -> convertNeg(node)
                is PartiqlPhysical.Expr.Plus -> convertPlus(node)
                is PartiqlPhysical.Expr.Minus -> convertMinus(node)
                is PartiqlPhysical.Expr.Times -> convertTimes(node)
                is PartiqlPhysical.Expr.Divide -> convertDivide(node)
                is PartiqlPhysical.Expr.Modulo -> convertModulo(node)
                is PartiqlPhysical.Expr.Concat -> convertConcat(node)
                is PartiqlPhysical.Expr.And -> convertAnd(node)
                is PartiqlPhysical.Expr.Or -> convertOr(node)
                is PartiqlPhysical.Expr.Eq -> convertEq(node)
                is PartiqlPhysical.Expr.Ne -> convertNe(node)
                is PartiqlPhysical.Expr.Gt -> convertGt(node)
                is PartiqlPhysical.Expr.Gte -> convertGte(node)
                is PartiqlPhysical.Expr.Lt -> convertLt(node)
                is PartiqlPhysical.Expr.Lte -> convertLte(node)
                is PartiqlPhysical.Expr.Like -> convertLike(node)
                is PartiqlPhysical.Expr.Between -> convertBetween(node)
                is PartiqlPhysical.Expr.InCollection -> convertInCollection(node)
                is PartiqlPhysical.Expr.IsType -> convertIsType(node)
                is PartiqlPhysical.Expr.SimpleCase -> convertSimpleCase(node)
                is PartiqlPhysical.Expr.SearchedCase -> convertSearchedCase(node)
                is PartiqlPhysical.Expr.Bag -> convertBag(node)
                is PartiqlPhysical.Expr.List -> convertList(node)
                is PartiqlPhysical.Expr.Sexp -> convertSexp(node)
                is PartiqlPhysical.Expr.Date -> convertDate(node)
                is PartiqlPhysical.Expr.LitTime -> convertLitTime(node)
                is PartiqlPhysical.Expr.BagOp -> convertBagOp(node)
                is PartiqlPhysical.Expr.GraphMatch -> convertGraphMatch(node)
                is PartiqlPhysical.Expr.Path -> convertPath(node)
                is PartiqlPhysical.Expr.Call -> convertCall(node)
                is PartiqlPhysical.Expr.Cast -> convertCast(node)
                is PartiqlPhysical.Expr.CanCast -> convertCanCast(node)
                is PartiqlPhysical.Expr.CanLosslessCast -> convertCanLosslessCast(node)
                is PartiqlPhysical.Expr.NullIf -> convertNullIf(node)
                is PartiqlPhysical.Expr.Coalesce -> convertCoalesce(node)
                is PartiqlPhysical.Expr.BindingsToValues -> convertBindingsToValues(node)
                is PartiqlPhysical.Expr.Struct -> convertStruct(node)
                is PartiqlPhysical.Expr.Pivot -> convertPivot(node)
                is PartiqlPhysical.Expr.LocalId -> convertLocalId(node)
                is PartiqlPhysical.Expr.GlobalId -> convertGlobalId(node)
            }
    
            fun convertMissing(node: PartiqlPhysical.Expr.Missing): T
            fun convertLit(node: PartiqlPhysical.Expr.Lit): T
            fun convertParameter(node: PartiqlPhysical.Expr.Parameter): T
            fun convertNot(node: PartiqlPhysical.Expr.Not): T
            fun convertPos(node: PartiqlPhysical.Expr.Pos): T
            fun convertNeg(node: PartiqlPhysical.Expr.Neg): T
            fun convertPlus(node: PartiqlPhysical.Expr.Plus): T
            fun convertMinus(node: PartiqlPhysical.Expr.Minus): T
            fun convertTimes(node: PartiqlPhysical.Expr.Times): T
            fun convertDivide(node: PartiqlPhysical.Expr.Divide): T
            fun convertModulo(node: PartiqlPhysical.Expr.Modulo): T
            fun convertConcat(node: PartiqlPhysical.Expr.Concat): T
            fun convertAnd(node: PartiqlPhysical.Expr.And): T
            fun convertOr(node: PartiqlPhysical.Expr.Or): T
            fun convertEq(node: PartiqlPhysical.Expr.Eq): T
            fun convertNe(node: PartiqlPhysical.Expr.Ne): T
            fun convertGt(node: PartiqlPhysical.Expr.Gt): T
            fun convertGte(node: PartiqlPhysical.Expr.Gte): T
            fun convertLt(node: PartiqlPhysical.Expr.Lt): T
            fun convertLte(node: PartiqlPhysical.Expr.Lte): T
            fun convertLike(node: PartiqlPhysical.Expr.Like): T
            fun convertBetween(node: PartiqlPhysical.Expr.Between): T
            fun convertInCollection(node: PartiqlPhysical.Expr.InCollection): T
            fun convertIsType(node: PartiqlPhysical.Expr.IsType): T
            fun convertSimpleCase(node: PartiqlPhysical.Expr.SimpleCase): T
            fun convertSearchedCase(node: PartiqlPhysical.Expr.SearchedCase): T
            fun convertBag(node: PartiqlPhysical.Expr.Bag): T
            fun convertList(node: PartiqlPhysical.Expr.List): T
            fun convertSexp(node: PartiqlPhysical.Expr.Sexp): T
            fun convertDate(node: PartiqlPhysical.Expr.Date): T
            fun convertLitTime(node: PartiqlPhysical.Expr.LitTime): T
            fun convertBagOp(node: PartiqlPhysical.Expr.BagOp): T
            fun convertGraphMatch(node: PartiqlPhysical.Expr.GraphMatch): T
            fun convertPath(node: PartiqlPhysical.Expr.Path): T
            fun convertCall(node: PartiqlPhysical.Expr.Call): T
            fun convertCast(node: PartiqlPhysical.Expr.Cast): T
            fun convertCanCast(node: PartiqlPhysical.Expr.CanCast): T
            fun convertCanLosslessCast(node: PartiqlPhysical.Expr.CanLosslessCast): T
            fun convertNullIf(node: PartiqlPhysical.Expr.NullIf): T
            fun convertCoalesce(node: PartiqlPhysical.Expr.Coalesce): T
            fun convertBindingsToValues(node: PartiqlPhysical.Expr.BindingsToValues): T
            fun convertStruct(node: PartiqlPhysical.Expr.Struct): T
            fun convertPivot(node: PartiqlPhysical.Expr.Pivot): T
            fun convertLocalId(node: PartiqlPhysical.Expr.LocalId): T
            fun convertGlobalId(node: PartiqlPhysical.Expr.GlobalId): T
        }
    }
    
    sealed class Statement(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        override fun copy(metas: MetaContainer): Statement =
            when (this) {
                is Query -> copy(metas = metas)
                is Exec -> copy(metas = metas)
                is Explain -> copy(metas = metas)
                is DmlQuery -> 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 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
        }
    
        class DmlQuery(
            val expr: Expr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Statement() {
        
            override fun copy(metas: MetaContainer): DmlQuery =
                DmlQuery(
                    expr = expr,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): DmlQuery =
                DmlQuery(
                    expr = expr,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("dml_query"),
                    expr.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                expr: Expr = this.expr,
                metas: MetaContainer = this.metas
            ) =
                DmlQuery(
                    expr,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != DmlQuery::class.java) return false
        
                other as DmlQuery
                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 [PartiqlPhysical.Statement] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.Statement): T = when(node) {
                is PartiqlPhysical.Statement.Query -> convertQuery(node)
                is PartiqlPhysical.Statement.Exec -> convertExec(node)
                is PartiqlPhysical.Statement.Explain -> convertExplain(node)
                is PartiqlPhysical.Statement.DmlQuery -> convertDmlQuery(node)
            }
    
            fun convertQuery(node: PartiqlPhysical.Statement.Query): T
            fun convertExec(node: PartiqlPhysical.Statement.Exec): T
            fun convertExplain(node: PartiqlPhysical.Statement.Explain): T
            fun convertDmlQuery(node: PartiqlPhysical.Statement.DmlQuery): T
        }
    }
    
    sealed class Bexpr(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlPhysicalNode() {
        override fun copy(metas: MetaContainer): Bexpr =
            when (this) {
                is Project -> copy(metas = metas)
                is Scan -> copy(metas = metas)
                is Unpivot -> copy(metas = metas)
                is Filter -> copy(metas = metas)
                is Join -> copy(metas = metas)
                is Sort -> copy(metas = metas)
                is Aggregate -> copy(metas = metas)
                is Offset -> copy(metas = metas)
                is Limit -> copy(metas = metas)
                is Let -> copy(metas = metas)
                is Window -> copy(metas = metas)
            }
    
        class Project(
            val i: Impl,
            val binding: VarDecl,
            val args: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Bexpr() {
        
            override fun copy(metas: MetaContainer): Project =
                Project(
                    i = i,
                    binding = binding,
                    args = args,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Project =
                Project(
                    i = i,
                    binding = binding,
                    args = args,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("project"),
                    i.toIonElement(),
                    binding.toIonElement(),
                    *args.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                i: Impl = this.i,
                binding: VarDecl = this.binding,
                args: kotlin.collections.List = this.args,
                metas: MetaContainer = this.metas
            ) =
                Project(
                    i,
                    binding,
                    args,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Project::class.java) return false
        
                other as Project
                if (i != other.i) return false
                if (binding != other.binding) return false
                if (args != other.args) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = i.hashCode()
                hc = 31 * hc + binding.hashCode()
                hc = 31 * hc + args.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Scan(
            val i: Impl,
            val expr: Expr,
            val asDecl: VarDecl,
            val atDecl: VarDecl?,
            val byDecl: VarDecl?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Bexpr() {
        
            override fun copy(metas: MetaContainer): Scan =
                Scan(
                    i = i,
                    expr = expr,
                    asDecl = asDecl,
                    atDecl = atDecl,
                    byDecl = byDecl,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Scan =
                Scan(
                    i = i,
                    expr = expr,
                    asDecl = asDecl,
                    atDecl = atDecl,
                    byDecl = byDecl,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("scan"),
                    i.toIonElement(),
                    expr.toIonElement(),
                    asDecl.toIonElement(),
                    atDecl?.toIonElement() ?: ionNull(),
                    byDecl?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                i: Impl = this.i,
                expr: Expr = this.expr,
                asDecl: VarDecl = this.asDecl,
                atDecl: VarDecl? = this.atDecl,
                byDecl: VarDecl? = this.byDecl,
                metas: MetaContainer = this.metas
            ) =
                Scan(
                    i,
                    expr,
                    asDecl,
                    atDecl,
                    byDecl,
                    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 (i != other.i) return false
                if (expr != other.expr) return false
                if (asDecl != other.asDecl) return false
                if (atDecl != other.atDecl) return false
                if (byDecl != other.byDecl) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = i.hashCode()
                hc = 31 * hc + expr.hashCode()
                hc = 31 * hc + asDecl.hashCode()
                hc = 31 * hc + atDecl.hashCode()
                hc = 31 * hc + byDecl.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Unpivot(
            val i: Impl,
            val expr: Expr,
            val asDecl: VarDecl,
            val atDecl: VarDecl?,
            val byDecl: VarDecl?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Bexpr() {
        
            override fun copy(metas: MetaContainer): Unpivot =
                Unpivot(
                    i = i,
                    expr = expr,
                    asDecl = asDecl,
                    atDecl = atDecl,
                    byDecl = byDecl,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Unpivot =
                Unpivot(
                    i = i,
                    expr = expr,
                    asDecl = asDecl,
                    atDecl = atDecl,
                    byDecl = byDecl,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("unpivot"),
                    i.toIonElement(),
                    expr.toIonElement(),
                    asDecl.toIonElement(),
                    atDecl?.toIonElement() ?: ionNull(),
                    byDecl?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                i: Impl = this.i,
                expr: Expr = this.expr,
                asDecl: VarDecl = this.asDecl,
                atDecl: VarDecl? = this.atDecl,
                byDecl: VarDecl? = this.byDecl,
                metas: MetaContainer = this.metas
            ) =
                Unpivot(
                    i,
                    expr,
                    asDecl,
                    atDecl,
                    byDecl,
                    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 (i != other.i) return false
                if (expr != other.expr) return false
                if (asDecl != other.asDecl) return false
                if (atDecl != other.atDecl) return false
                if (byDecl != other.byDecl) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = i.hashCode()
                hc = 31 * hc + expr.hashCode()
                hc = 31 * hc + asDecl.hashCode()
                hc = 31 * hc + atDecl.hashCode()
                hc = 31 * hc + byDecl.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Filter(
            val i: Impl,
            val predicate: Expr,
            val source: Bexpr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Bexpr() {
        
            override fun copy(metas: MetaContainer): Filter =
                Filter(
                    i = i,
                    predicate = predicate,
                    source = source,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Filter =
                Filter(
                    i = i,
                    predicate = predicate,
                    source = source,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("filter"),
                    i.toIonElement(),
                    predicate.toIonElement(),
                    source.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                i: Impl = this.i,
                predicate: Expr = this.predicate,
                source: Bexpr = this.source,
                metas: MetaContainer = this.metas
            ) =
                Filter(
                    i,
                    predicate,
                    source,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Filter::class.java) return false
        
                other as Filter
                if (i != other.i) return false
                if (predicate != other.predicate) return false
                if (source != other.source) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = i.hashCode()
                hc = 31 * hc + predicate.hashCode()
                hc = 31 * hc + source.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Join(
            val i: Impl,
            val joinType: JoinType,
            val left: Bexpr,
            val right: Bexpr,
            val predicate: Expr?,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Bexpr() {
        
            override fun copy(metas: MetaContainer): Join =
                Join(
                    i = i,
                    joinType = joinType,
                    left = left,
                    right = right,
                    predicate = predicate,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Join =
                Join(
                    i = i,
                    joinType = joinType,
                    left = left,
                    right = right,
                    predicate = predicate,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("join"),
                    i.toIonElement(),
                    joinType.toIonElement(),
                    left.toIonElement(),
                    right.toIonElement(),
                    predicate?.toIonElement() ?: ionNull(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                i: Impl = this.i,
                joinType: JoinType = this.joinType,
                left: Bexpr = this.left,
                right: Bexpr = this.right,
                predicate: Expr? = this.predicate,
                metas: MetaContainer = this.metas
            ) =
                Join(
                    i,
                    joinType,
                    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 (i != other.i) return false
                if (joinType != other.joinType) 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 = i.hashCode()
                hc = 31 * hc + joinType.hashCode()
                hc = 31 * hc + left.hashCode()
                hc = 31 * hc + right.hashCode()
                hc = 31 * hc + predicate.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Sort(
            val i: Impl,
            val source: Bexpr,
            val sortSpecs: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Bexpr() {
        
            override fun copy(metas: MetaContainer): Sort =
                Sort(
                    i = i,
                    source = source,
                    sortSpecs = sortSpecs,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Sort =
                Sort(
                    i = i,
                    source = source,
                    sortSpecs = sortSpecs,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("sort"),
                    i.toIonElement(),
                    source.toIonElement(),
                    *sortSpecs.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                i: Impl = this.i,
                source: Bexpr = this.source,
                sortSpecs: kotlin.collections.List = this.sortSpecs,
                metas: MetaContainer = this.metas
            ) =
                Sort(
                    i,
                    source,
                    sortSpecs,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Sort::class.java) return false
        
                other as Sort
                if (i != other.i) return false
                if (source != other.source) return false
                if (sortSpecs != other.sortSpecs) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = i.hashCode()
                hc = 31 * hc + source.hashCode()
                hc = 31 * hc + sortSpecs.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Aggregate(
            val i: Impl,
            val source: Bexpr,
            val strategy: GroupingStrategy,
            val groupList: GroupKeyList,
            val functionList: AggregateFunctionList,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Bexpr() {
        
            override fun copy(metas: MetaContainer): Aggregate =
                Aggregate(
                    i = i,
                    source = source,
                    strategy = strategy,
                    groupList = groupList,
                    functionList = functionList,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Aggregate =
                Aggregate(
                    i = i,
                    source = source,
                    strategy = strategy,
                    groupList = groupList,
                    functionList = functionList,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("aggregate"),
                    i.toIonElement(),
                    source.toIonElement(),
                    strategy.toIonElement(),
                    groupList.toIonElement(),
                    functionList.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                i: Impl = this.i,
                source: Bexpr = this.source,
                strategy: GroupingStrategy = this.strategy,
                groupList: GroupKeyList = this.groupList,
                functionList: AggregateFunctionList = this.functionList,
                metas: MetaContainer = this.metas
            ) =
                Aggregate(
                    i,
                    source,
                    strategy,
                    groupList,
                    functionList,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Aggregate::class.java) return false
        
                other as Aggregate
                if (i != other.i) return false
                if (source != other.source) return false
                if (strategy != other.strategy) return false
                if (groupList != other.groupList) return false
                if (functionList != other.functionList) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = i.hashCode()
                hc = 31 * hc + source.hashCode()
                hc = 31 * hc + strategy.hashCode()
                hc = 31 * hc + groupList.hashCode()
                hc = 31 * hc + functionList.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Offset(
            val i: Impl,
            val rowCount: Expr,
            val source: Bexpr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Bexpr() {
        
            override fun copy(metas: MetaContainer): Offset =
                Offset(
                    i = i,
                    rowCount = rowCount,
                    source = source,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Offset =
                Offset(
                    i = i,
                    rowCount = rowCount,
                    source = source,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("offset"),
                    i.toIonElement(),
                    rowCount.toIonElement(),
                    source.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                i: Impl = this.i,
                rowCount: Expr = this.rowCount,
                source: Bexpr = this.source,
                metas: MetaContainer = this.metas
            ) =
                Offset(
                    i,
                    rowCount,
                    source,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Offset::class.java) return false
        
                other as Offset
                if (i != other.i) return false
                if (rowCount != other.rowCount) return false
                if (source != other.source) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = i.hashCode()
                hc = 31 * hc + rowCount.hashCode()
                hc = 31 * hc + source.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Limit(
            val i: Impl,
            val rowCount: Expr,
            val source: Bexpr,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Bexpr() {
        
            override fun copy(metas: MetaContainer): Limit =
                Limit(
                    i = i,
                    rowCount = rowCount,
                    source = source,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Limit =
                Limit(
                    i = i,
                    rowCount = rowCount,
                    source = source,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("limit"),
                    i.toIonElement(),
                    rowCount.toIonElement(),
                    source.toIonElement(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                i: Impl = this.i,
                rowCount: Expr = this.rowCount,
                source: Bexpr = this.source,
                metas: MetaContainer = this.metas
            ) =
                Limit(
                    i,
                    rowCount,
                    source,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Limit::class.java) return false
        
                other as Limit
                if (i != other.i) return false
                if (rowCount != other.rowCount) return false
                if (source != other.source) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = i.hashCode()
                hc = 31 * hc + rowCount.hashCode()
                hc = 31 * hc + source.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Let(
            val i: Impl,
            val source: Bexpr,
            val bindings: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Bexpr() {
        
            override fun copy(metas: MetaContainer): Let =
                Let(
                    i = i,
                    source = source,
                    bindings = bindings,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Let =
                Let(
                    i = i,
                    source = source,
                    bindings = bindings,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("let"),
                    i.toIonElement(),
                    source.toIonElement(),
                    *bindings.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                i: Impl = this.i,
                source: Bexpr = this.source,
                bindings: kotlin.collections.List = this.bindings,
                metas: MetaContainer = this.metas
            ) =
                Let(
                    i,
                    source,
                    bindings,
                    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 (i != other.i) return false
                if (source != other.source) return false
                if (bindings != other.bindings) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = i.hashCode()
                hc = 31 * hc + source.hashCode()
                hc = 31 * hc + bindings.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        class Window(
            val i: Impl,
            val source: Bexpr,
            val windowSpecification: Over,
            val windowExpressionList: kotlin.collections.List,
            override val metas: MetaContainer = emptyMetaContainer()
        ): Bexpr() {
        
            override fun copy(metas: MetaContainer): Window =
                Window(
                    i = i,
                    source = source,
                    windowSpecification = windowSpecification,
                    windowExpressionList = windowExpressionList,
                    metas = metas)
        
            override fun withMeta(metaKey: String, metaValue: Any): Window =
                Window(
                    i = i,
                    source = source,
                    windowSpecification = windowSpecification,
                    windowExpressionList = windowExpressionList,
                    metas = metas + metaContainerOf(metaKey to metaValue))
        
            override fun toIonElement(): SexpElement {
                val elements = ionSexpOf(
                    ionSymbol("window"),
                    i.toIonElement(),
                    source.toIonElement(),
                    windowSpecification.toIonElement(),
                    *windowExpressionList.map { it.toIonElement() }.toTypedArray(),
                    metas = metas)
                return elements
            }
        
            fun copy(
                i: Impl = this.i,
                source: Bexpr = this.source,
                windowSpecification: Over = this.windowSpecification,
                windowExpressionList: kotlin.collections.List = this.windowExpressionList,
                metas: MetaContainer = this.metas
            ) =
                Window(
                    i,
                    source,
                    windowSpecification,
                    windowExpressionList,
                    metas)
        
            override fun equals(other: Any?): Boolean {
                if (other == null) return false
                if (this === other) return true
                if (other.javaClass != Window::class.java) return false
        
                other as Window
                if (i != other.i) return false
                if (source != other.source) return false
                if (windowSpecification != other.windowSpecification) return false
                if (windowExpressionList != other.windowExpressionList) return false
                return true
            }
        
            private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
                var hc = i.hashCode()
                hc = 31 * hc + source.hashCode()
                hc = 31 * hc + windowSpecification.hashCode()
                hc = 31 * hc + windowExpressionList.hashCode()
                hc
            }
        
            override fun hashCode(): Int = myHashCode
        }
    
        /** Converts instances of [PartiqlPhysical.Bexpr] to any [T]. */
        interface Converter {
            fun convert(node: PartiqlPhysical.Bexpr): T = when(node) {
                is PartiqlPhysical.Bexpr.Project -> convertProject(node)
                is PartiqlPhysical.Bexpr.Scan -> convertScan(node)
                is PartiqlPhysical.Bexpr.Unpivot -> convertUnpivot(node)
                is PartiqlPhysical.Bexpr.Filter -> convertFilter(node)
                is PartiqlPhysical.Bexpr.Join -> convertJoin(node)
                is PartiqlPhysical.Bexpr.Sort -> convertSort(node)
                is PartiqlPhysical.Bexpr.Aggregate -> convertAggregate(node)
                is PartiqlPhysical.Bexpr.Offset -> convertOffset(node)
                is PartiqlPhysical.Bexpr.Limit -> convertLimit(node)
                is PartiqlPhysical.Bexpr.Let -> convertLet(node)
                is PartiqlPhysical.Bexpr.Window -> convertWindow(node)
            }
    
            fun convertProject(node: PartiqlPhysical.Bexpr.Project): T
            fun convertScan(node: PartiqlPhysical.Bexpr.Scan): T
            fun convertUnpivot(node: PartiqlPhysical.Bexpr.Unpivot): T
            fun convertFilter(node: PartiqlPhysical.Bexpr.Filter): T
            fun convertJoin(node: PartiqlPhysical.Bexpr.Join): T
            fun convertSort(node: PartiqlPhysical.Bexpr.Sort): T
            fun convertAggregate(node: PartiqlPhysical.Bexpr.Aggregate): T
            fun convertOffset(node: PartiqlPhysical.Bexpr.Offset): T
            fun convertLimit(node: PartiqlPhysical.Bexpr.Limit): T
            fun convertLet(node: PartiqlPhysical.Bexpr.Let): T
            fun convertWindow(node: PartiqlPhysical.Bexpr.Window): T
        }
    }
    
    /////////////////////////////////////////////////////////////////////////////
    // IonElementTransformer
    /////////////////////////////////////////////////////////////////////////////
    
    
    private class IonElementTransformer : IonElementTransformerBase() {
    
        override fun innerTransform(sexp: SexpElement): PartiqlPhysicalNode {
            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()
                    PartiqlPhysical.TimeValue(
                        hour,
                        minute,
                        second,
                        nano,
                        precision,
                        withTimeZone,
                        tzMinutes,
                        metas = sexp.metas)
                }
                "graph_match_quantifier" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 2))
                    val lower = sexp.getRequired(0).toLongPrimitive()
                    val upper = sexp.getOptional(1)?.toLongPrimitive()
                    PartiqlPhysical.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() }
                    PartiqlPhysical.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() }
                    PartiqlPhysical.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()
                    PartiqlPhysical.ExprPair(
                        first,
                        second,
                        metas = sexp.metas)
                }
                "expr_pair_list" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val pairs = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.ExprPairList(
                        pairs,
                        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()
                    PartiqlPhysical.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()
                    PartiqlPhysical.Over(
                        partitionBy,
                        orderBy,
                        metas = sexp.metas)
                }
                "window_partition_list" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val exprs = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.WindowPartitionList(
                        exprs,
                        metas = sexp.metas)
                }
                "window_sort_spec_list" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val sortSpecs = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.WindowSortSpecList(
                        sortSpecs,
                        metas = sexp.metas)
                }
                "identifier" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val name = sexp.getRequired(0).toSymbolPrimitive()
                    val case = sexp.getRequired(1).transformExpect()
                    PartiqlPhysical.Identifier(
                        name,
                        case,
                        metas = sexp.metas)
                }
                "let_binding" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val value = sexp.getRequired(0).transformExpect()
                    val decl = sexp.getRequired(1).transformExpect()
                    PartiqlPhysical.LetBinding(
                        value,
                        decl,
                        metas = sexp.metas)
                }
                "group_key" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val expr = sexp.getRequired(0).transformExpect()
                    val asVar = sexp.getRequired(1).transformExpect()
                    PartiqlPhysical.GroupKey(
                        expr,
                        asVar,
                        metas = sexp.metas)
                }
                "group_key_list" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val keys = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.GroupKeyList(
                        keys,
                        metas = sexp.metas)
                }
                "aggregate_function" -> {
                    sexp.requireArityOrMalformed(IntRange(4, 4))
                    val quantifier = sexp.getRequired(0).transformExpect()
                    val name = sexp.getRequired(1).toSymbolPrimitive()
                    val arg = sexp.getRequired(2).transformExpect()
                    val asVar = sexp.getRequired(3).transformExpect()
                    PartiqlPhysical.AggregateFunction(
                        quantifier,
                        name,
                        arg,
                        asVar,
                        metas = sexp.metas)
                }
                "aggregate_function_list" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val functions = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.AggregateFunctionList(
                        functions,
                        metas = sexp.metas)
                }
                "window_expression" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2147483647))
                    val decl = sexp.getRequired(0).transformExpect()
                    val funcName = sexp.getRequired(1).toSymbolPrimitive()
                    val args = sexp.values.drop(3).map { it.transformExpect() }
                    PartiqlPhysical.WindowExpression(
                        decl,
                        funcName,
                        args,
                        metas = sexp.metas)
                }
                "plan" -> {
                    val ir = sexp.transformToIntermediateRecord()
            
                    val stmt = ir.processRequiredField("stmt") { it.transformExpect() }
                    val version = ir.processRequiredField("version") { it.toSymbolPrimitive() }
                    val locals = ir.processVariadicField("locals", 0) { it.transformExpect() }
            
                    ir.malformedIfAnyUnprocessedFieldsRemain()
            
                    Plan(stmt, version, locals, metas = sexp.metas)
                }
                "local_variable" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val name = sexp.getRequired(0).toSymbolPrimitive()
                    val registerIndex = sexp.getRequired(1).toLongPrimitive()
                    PartiqlPhysical.LocalVariable(
                        name,
                        registerIndex,
                        metas = sexp.metas)
                }
                "var_decl" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val index = sexp.getRequired(0).toLongPrimitive()
                    PartiqlPhysical.VarDecl(
                        index,
                        metas = sexp.metas)
                }
                "impl" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 2147483647))
                    val name = sexp.getRequired(0).toSymbolPrimitive()
                    val staticArgs = sexp.values.drop(2).map { it }
                    PartiqlPhysical.Impl(
                        name,
                        staticArgs,
                        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()
                    PartiqlPhysical.ExplainTarget.Domain(
                        statement,
                        type,
                        format,
                        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()
                    PartiqlPhysical.PathStep.PathExpr(
                        index,
                        case,
                        metas = sexp.metas)
                }
                "path_wildcard" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.PathStep.PathWildcard(
                        metas = sexp.metas)
                }
                "path_unpivot" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.PathStep.PathUnpivot(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'JoinType'
                //////////////////////////////////////
                "inner" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.JoinType.Inner(
                        metas = sexp.metas)
                }
                "left" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.JoinType.Left(
                        metas = sexp.metas)
                }
                "right" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.JoinType.Right(
                        metas = sexp.metas)
                }
                "full" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.JoinType.Full(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'GraphMatchDirection'
                //////////////////////////////////////
                "edge_left" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GraphMatchDirection.EdgeLeft(
                        metas = sexp.metas)
                }
                "edge_undirected" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GraphMatchDirection.EdgeUndirected(
                        metas = sexp.metas)
                }
                "edge_right" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GraphMatchDirection.EdgeRight(
                        metas = sexp.metas)
                }
                "edge_left_or_undirected" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected(
                        metas = sexp.metas)
                }
                "edge_undirected_or_right" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight(
                        metas = sexp.metas)
                }
                "edge_left_or_right" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight(
                        metas = sexp.metas)
                }
                "edge_left_or_undirected_or_right" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.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() }
                    PartiqlPhysical.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() }
                    PartiqlPhysical.GraphMatchPatternPart.Edge(
                        direction,
                        quantifier,
                        prefilter,
                        variable,
                        label,
                        metas = sexp.metas)
                }
                "pattern" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val pattern = sexp.getRequired(0).transformExpect()
                    PartiqlPhysical.GraphMatchPatternPart.Pattern(
                        pattern,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'GraphMatchRestrictor'
                //////////////////////////////////////
                "restrictor_trail" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail(
                        metas = sexp.metas)
                }
                "restrictor_acyclic" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic(
                        metas = sexp.metas)
                }
                "restrictor_simple" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'GraphMatchSelector'
                //////////////////////////////////////
                "selector_any_shortest" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest(
                        metas = sexp.metas)
                }
                "selector_all_shortest" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GraphMatchSelector.SelectorAllShortest(
                        metas = sexp.metas)
                }
                "selector_any" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GraphMatchSelector.SelectorAny(
                        metas = sexp.metas)
                }
                "selector_any_k" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val k = sexp.getRequired(0).toLongPrimitive()
                    PartiqlPhysical.GraphMatchSelector.SelectorAnyK(
                        k,
                        metas = sexp.metas)
                }
                "selector_shortest_k" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val k = sexp.getRequired(0).toLongPrimitive()
                    PartiqlPhysical.GraphMatchSelector.SelectorShortestK(
                        k,
                        metas = sexp.metas)
                }
                "selector_shortest_k_group" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val k = sexp.getRequired(0).toLongPrimitive()
                    PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup(
                        k,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'GroupingStrategy'
                //////////////////////////////////////
                "group_full" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GroupingStrategy.GroupFull(
                        metas = sexp.metas)
                }
                "group_partial" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.GroupingStrategy.GroupPartial(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'OrderingSpec'
                //////////////////////////////////////
                "asc" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.OrderingSpec.Asc(
                        metas = sexp.metas)
                }
                "desc" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.OrderingSpec.Desc(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'NullsSpec'
                //////////////////////////////////////
                "nulls_first" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.NullsSpec.NullsFirst(
                        metas = sexp.metas)
                }
                "nulls_last" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.NullsSpec.NullsLast(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'CaseSensitivity'
                //////////////////////////////////////
                "case_sensitive" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.CaseSensitivity.CaseSensitive(
                        metas = sexp.metas)
                }
                "case_insensitive" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.CaseSensitivity.CaseInsensitive(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'SetQuantifier'
                //////////////////////////////////////
                "all" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.SetQuantifier.All(
                        metas = sexp.metas)
                }
                "distinct" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.SetQuantifier.Distinct(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'BagOpType'
                //////////////////////////////////////
                "union" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.BagOpType.Union(
                        metas = sexp.metas)
                }
                "intersect" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.BagOpType.Intersect(
                        metas = sexp.metas)
                }
                "except" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.BagOpType.Except(
                        metas = sexp.metas)
                }
                "outer_union" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.BagOpType.OuterUnion(
                        metas = sexp.metas)
                }
                "outer_intersect" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.BagOpType.OuterIntersect(
                        metas = sexp.metas)
                }
                "outer_except" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.BagOpType.OuterExcept(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'OnConflictValue'
                //////////////////////////////////////
                "excluded" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.OnConflictValue.Excluded(
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'Type'
                //////////////////////////////////////
                "null_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.NullType(
                        metas = sexp.metas)
                }
                "boolean_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.BooleanType(
                        metas = sexp.metas)
                }
                "smallint_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.SmallintType(
                        metas = sexp.metas)
                }
                "integer4_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.Integer4Type(
                        metas = sexp.metas)
                }
                "integer8_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.Integer8Type(
                        metas = sexp.metas)
                }
                "integer_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.IntegerType(
                        metas = sexp.metas)
                }
                "float_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 1))
                    val precision = sexp.getOptional(0)?.toLongPrimitive()
                    PartiqlPhysical.Type.FloatType(
                        precision,
                        metas = sexp.metas)
                }
                "real_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.RealType(
                        metas = sexp.metas)
                }
                "double_precision_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.DoublePrecisionType(
                        metas = sexp.metas)
                }
                "decimal_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2))
                    val precision = sexp.getOptional(0)?.toLongPrimitive()
                    val scale = sexp.getOptional(1)?.toLongPrimitive()
                    PartiqlPhysical.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()
                    PartiqlPhysical.Type.NumericType(
                        precision,
                        scale,
                        metas = sexp.metas)
                }
                "timestamp_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.TimestampType(
                        metas = sexp.metas)
                }
                "character_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 1))
                    val length = sexp.getOptional(0)?.toLongPrimitive()
                    PartiqlPhysical.Type.CharacterType(
                        length,
                        metas = sexp.metas)
                }
                "character_varying_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 1))
                    val length = sexp.getOptional(0)?.toLongPrimitive()
                    PartiqlPhysical.Type.CharacterVaryingType(
                        length,
                        metas = sexp.metas)
                }
                "missing_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.MissingType(
                        metas = sexp.metas)
                }
                "string_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.StringType(
                        metas = sexp.metas)
                }
                "symbol_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.SymbolType(
                        metas = sexp.metas)
                }
                "blob_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.BlobType(
                        metas = sexp.metas)
                }
                "clob_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.ClobType(
                        metas = sexp.metas)
                }
                "date_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.DateType(
                        metas = sexp.metas)
                }
                "time_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 1))
                    val precision = sexp.getOptional(0)?.toLongPrimitive()
                    PartiqlPhysical.Type.TimeType(
                        precision,
                        metas = sexp.metas)
                }
                "time_with_time_zone_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 1))
                    val precision = sexp.getOptional(0)?.toLongPrimitive()
                    PartiqlPhysical.Type.TimeWithTimeZoneType(
                        precision,
                        metas = sexp.metas)
                }
                "struct_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.StructType(
                        metas = sexp.metas)
                }
                "tuple_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.TupleType(
                        metas = sexp.metas)
                }
                "list_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.ListType(
                        metas = sexp.metas)
                }
                "sexp_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.SexpType(
                        metas = sexp.metas)
                }
                "bag_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.BagType(
                        metas = sexp.metas)
                }
                "any_type" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Type.AnyType(
                        metas = sexp.metas)
                }
                "custom_type" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val name = sexp.getRequired(0).toSymbolPrimitive()
                    PartiqlPhysical.Type.CustomType(
                        name,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'StructPart'
                //////////////////////////////////////
                "struct_fields" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val partExpr = sexp.getRequired(0).transformExpect()
                    PartiqlPhysical.StructPart.StructFields(
                        partExpr,
                        metas = sexp.metas)
                }
                "struct_field" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val fieldName = sexp.getRequired(0).transformExpect()
                    val value = sexp.getRequired(1).transformExpect()
                    PartiqlPhysical.StructPart.StructField(
                        fieldName,
                        value,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'Expr'
                //////////////////////////////////////
                "missing" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 0))
                    PartiqlPhysical.Expr.Missing(
                        metas = sexp.metas)
                }
                "lit" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val value = sexp.getRequiredIon(0)
                    PartiqlPhysical.Expr.Lit(
                        value,
                        metas = sexp.metas)
                }
                "parameter" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val index = sexp.getRequired(0).toLongPrimitive()
                    PartiqlPhysical.Expr.Parameter(
                        index,
                        metas = sexp.metas)
                }
                "not" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val expr = sexp.getRequired(0).transformExpect()
                    PartiqlPhysical.Expr.Not(
                        expr,
                        metas = sexp.metas)
                }
                "pos" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val expr = sexp.getRequired(0).transformExpect()
                    PartiqlPhysical.Expr.Pos(
                        expr,
                        metas = sexp.metas)
                }
                "neg" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val expr = sexp.getRequired(0).transformExpect()
                    PartiqlPhysical.Expr.Neg(
                        expr,
                        metas = sexp.metas)
                }
                "plus" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Plus(
                        operands,
                        metas = sexp.metas)
                }
                "minus" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Minus(
                        operands,
                        metas = sexp.metas)
                }
                "times" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Times(
                        operands,
                        metas = sexp.metas)
                }
                "divide" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Divide(
                        operands,
                        metas = sexp.metas)
                }
                "modulo" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Modulo(
                        operands,
                        metas = sexp.metas)
                }
                "concat" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Concat(
                        operands,
                        metas = sexp.metas)
                }
                "and" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.And(
                        operands,
                        metas = sexp.metas)
                }
                "or" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Or(
                        operands,
                        metas = sexp.metas)
                }
                "eq" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Eq(
                        operands,
                        metas = sexp.metas)
                }
                "ne" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Ne(
                        operands,
                        metas = sexp.metas)
                }
                "gt" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Gt(
                        operands,
                        metas = sexp.metas)
                }
                "gte" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Gte(
                        operands,
                        metas = sexp.metas)
                }
                "lt" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Lt(
                        operands,
                        metas = sexp.metas)
                }
                "lte" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.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()
                    PartiqlPhysical.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()
                    PartiqlPhysical.Expr.Between(
                        value,
                        from,
                        to,
                        metas = sexp.metas)
                }
                "in_collection" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val operands = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.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()
                    PartiqlPhysical.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()
                    PartiqlPhysical.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()
                    PartiqlPhysical.Expr.SearchedCase(
                        cases,
                        default,
                        metas = sexp.metas)
                }
                "bag" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val values = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Bag(
                        values,
                        metas = sexp.metas)
                }
                "list" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val values = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.List(
                        values,
                        metas = sexp.metas)
                }
                "sexp" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val values = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.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()
                    PartiqlPhysical.Expr.Date(
                        year,
                        month,
                        day,
                        metas = sexp.metas)
                }
                "lit_time" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val value = sexp.getRequired(0).transformExpect()
                    PartiqlPhysical.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() }
                    PartiqlPhysical.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()
                    PartiqlPhysical.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() }
                    PartiqlPhysical.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() }
                    PartiqlPhysical.Expr.Call(
                        funcName,
                        args,
                        metas = sexp.metas)
                }
                "cast" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val value = sexp.getRequired(0).transformExpect()
                    val asType = sexp.getRequired(1).transformExpect()
                    PartiqlPhysical.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()
                    PartiqlPhysical.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()
                    PartiqlPhysical.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()
                    PartiqlPhysical.Expr.NullIf(
                        expr1,
                        expr2,
                        metas = sexp.metas)
                }
                "coalesce" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val args = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Coalesce(
                        args,
                        metas = sexp.metas)
                }
                "bindings_to_values" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2))
                    val exp = sexp.getRequired(0).transformExpect()
                    val query = sexp.getRequired(1).transformExpect()
                    PartiqlPhysical.Expr.BindingsToValues(
                        exp,
                        query,
                        metas = sexp.metas)
                }
                "struct" -> {
                    sexp.requireArityOrMalformed(IntRange(0, 2147483647))
                    val parts = sexp.values.drop(1).map { it.transformExpect() }
                    PartiqlPhysical.Expr.Struct(
                        parts,
                        metas = sexp.metas)
                }
                "pivot" -> {
                    sexp.requireArityOrMalformed(IntRange(3, 3))
                    val input = sexp.getRequired(0).transformExpect()
                    val key = sexp.getRequired(1).transformExpect()
                    val value = sexp.getRequired(2).transformExpect()
                    PartiqlPhysical.Expr.Pivot(
                        input,
                        key,
                        value,
                        metas = sexp.metas)
                }
                "local_id" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val index = sexp.getRequired(0).toLongPrimitive()
                    PartiqlPhysical.Expr.LocalId(
                        index,
                        metas = sexp.metas)
                }
                "global_id" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val uniqueId = sexp.getRequired(0).toSymbolPrimitive()
                    PartiqlPhysical.Expr.GlobalId(
                        uniqueId,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'Statement'
                //////////////////////////////////////
                "query" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val expr = sexp.getRequired(0).transformExpect()
                    PartiqlPhysical.Statement.Query(
                        expr,
                        metas = sexp.metas)
                }
                "exec" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 2147483647))
                    val procedureName = sexp.getRequired(0).toSymbolPrimitive()
                    val args = sexp.values.drop(2).map { it.transformExpect() }
                    PartiqlPhysical.Statement.Exec(
                        procedureName,
                        args,
                        metas = sexp.metas)
                }
                "explain" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val target = sexp.getRequired(0).transformExpect()
                    PartiqlPhysical.Statement.Explain(
                        target,
                        metas = sexp.metas)
                }
                "dml_query" -> {
                    sexp.requireArityOrMalformed(IntRange(1, 1))
                    val expr = sexp.getRequired(0).transformExpect()
                    PartiqlPhysical.Statement.DmlQuery(
                        expr,
                        metas = sexp.metas)
                }
                //////////////////////////////////////
                // Variants for Sum Type 'Bexpr'
                //////////////////////////////////////
                "project" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2147483647))
                    val i = sexp.getRequired(0).transformExpect()
                    val binding = sexp.getRequired(1).transformExpect()
                    val args = sexp.values.drop(3).map { it.transformExpect() }
                    PartiqlPhysical.Bexpr.Project(
                        i,
                        binding,
                        args,
                        metas = sexp.metas)
                }
                "scan" -> {
                    sexp.requireArityOrMalformed(IntRange(3, 5))
                    val i = sexp.getRequired(0).transformExpect()
                    val expr = sexp.getRequired(1).transformExpect()
                    val asDecl = sexp.getRequired(2).transformExpect()
                    val atDecl = sexp.getOptional(3)?.transformExpect()
                    val byDecl = sexp.getOptional(4)?.transformExpect()
                    PartiqlPhysical.Bexpr.Scan(
                        i,
                        expr,
                        asDecl,
                        atDecl,
                        byDecl,
                        metas = sexp.metas)
                }
                "unpivot" -> {
                    sexp.requireArityOrMalformed(IntRange(3, 5))
                    val i = sexp.getRequired(0).transformExpect()
                    val expr = sexp.getRequired(1).transformExpect()
                    val asDecl = sexp.getRequired(2).transformExpect()
                    val atDecl = sexp.getOptional(3)?.transformExpect()
                    val byDecl = sexp.getOptional(4)?.transformExpect()
                    PartiqlPhysical.Bexpr.Unpivot(
                        i,
                        expr,
                        asDecl,
                        atDecl,
                        byDecl,
                        metas = sexp.metas)
                }
                "filter" -> {
                    sexp.requireArityOrMalformed(IntRange(3, 3))
                    val i = sexp.getRequired(0).transformExpect()
                    val predicate = sexp.getRequired(1).transformExpect()
                    val source = sexp.getRequired(2).transformExpect()
                    PartiqlPhysical.Bexpr.Filter(
                        i,
                        predicate,
                        source,
                        metas = sexp.metas)
                }
                "join" -> {
                    sexp.requireArityOrMalformed(IntRange(4, 5))
                    val i = sexp.getRequired(0).transformExpect()
                    val joinType = sexp.getRequired(1).transformExpect()
                    val left = sexp.getRequired(2).transformExpect()
                    val right = sexp.getRequired(3).transformExpect()
                    val predicate = sexp.getOptional(4)?.transformExpect()
                    PartiqlPhysical.Bexpr.Join(
                        i,
                        joinType,
                        left,
                        right,
                        predicate,
                        metas = sexp.metas)
                }
                "sort" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2147483647))
                    val i = sexp.getRequired(0).transformExpect()
                    val source = sexp.getRequired(1).transformExpect()
                    val sortSpecs = sexp.values.drop(3).map { it.transformExpect() }
                    PartiqlPhysical.Bexpr.Sort(
                        i,
                        source,
                        sortSpecs,
                        metas = sexp.metas)
                }
                "aggregate" -> {
                    sexp.requireArityOrMalformed(IntRange(5, 5))
                    val i = sexp.getRequired(0).transformExpect()
                    val source = sexp.getRequired(1).transformExpect()
                    val strategy = sexp.getRequired(2).transformExpect()
                    val groupList = sexp.getRequired(3).transformExpect()
                    val functionList = sexp.getRequired(4).transformExpect()
                    PartiqlPhysical.Bexpr.Aggregate(
                        i,
                        source,
                        strategy,
                        groupList,
                        functionList,
                        metas = sexp.metas)
                }
                "offset" -> {
                    sexp.requireArityOrMalformed(IntRange(3, 3))
                    val i = sexp.getRequired(0).transformExpect()
                    val rowCount = sexp.getRequired(1).transformExpect()
                    val source = sexp.getRequired(2).transformExpect()
                    PartiqlPhysical.Bexpr.Offset(
                        i,
                        rowCount,
                        source,
                        metas = sexp.metas)
                }
                "limit" -> {
                    sexp.requireArityOrMalformed(IntRange(3, 3))
                    val i = sexp.getRequired(0).transformExpect()
                    val rowCount = sexp.getRequired(1).transformExpect()
                    val source = sexp.getRequired(2).transformExpect()
                    PartiqlPhysical.Bexpr.Limit(
                        i,
                        rowCount,
                        source,
                        metas = sexp.metas)
                }
                "let" -> {
                    sexp.requireArityOrMalformed(IntRange(2, 2147483647))
                    val i = sexp.getRequired(0).transformExpect()
                    val source = sexp.getRequired(1).transformExpect()
                    val bindings = sexp.values.drop(3).map { it.transformExpect() }
                    PartiqlPhysical.Bexpr.Let(
                        i,
                        source,
                        bindings,
                        metas = sexp.metas)
                }
                "window" -> {
                    sexp.requireArityOrMalformed(IntRange(3, 2147483647))
                    val i = sexp.getRequired(0).transformExpect()
                    val source = sexp.getRequired(1).transformExpect()
                    val windowSpecification = sexp.getRequired(2).transformExpect()
                    val windowExpressionList = sexp.values.drop(4).map { it.transformExpect() }
                    PartiqlPhysical.Bexpr.Window(
                        i,
                        source,
                        windowSpecification,
                        windowExpressionList,
                        metas = sexp.metas)
                }
                else -> errMalformed(sexp.head.metas.location, "Unknown tag '${sexp.tag}' for domain 'partiql_physical'")
            }
        }
    }
    
    open class Visitor : DomainVisitorBase() {
        ////////////////////////////////////////////////////////////////////////////
        // Visit Functions
        ////////////////////////////////////////////////////////////////////////////
    
        //////////////////////////////////////
        // Tuple Types
        //////////////////////////////////////
        open fun visitTimeValue(node: PartiqlPhysical.TimeValue) { }
        open fun visitGraphMatchQuantifier(node: PartiqlPhysical.GraphMatchQuantifier) { }
        open fun visitGraphMatchPattern(node: PartiqlPhysical.GraphMatchPattern) { }
        open fun visitGpmlPattern(node: PartiqlPhysical.GpmlPattern) { }
        open fun visitExprPair(node: PartiqlPhysical.ExprPair) { }
        open fun visitExprPairList(node: PartiqlPhysical.ExprPairList) { }
        open fun visitSortSpec(node: PartiqlPhysical.SortSpec) { }
        open fun visitOver(node: PartiqlPhysical.Over) { }
        open fun visitWindowPartitionList(node: PartiqlPhysical.WindowPartitionList) { }
        open fun visitWindowSortSpecList(node: PartiqlPhysical.WindowSortSpecList) { }
        open fun visitIdentifier(node: PartiqlPhysical.Identifier) { }
        open fun visitLetBinding(node: PartiqlPhysical.LetBinding) { }
        open fun visitGroupKey(node: PartiqlPhysical.GroupKey) { }
        open fun visitGroupKeyList(node: PartiqlPhysical.GroupKeyList) { }
        open fun visitAggregateFunction(node: PartiqlPhysical.AggregateFunction) { }
        open fun visitAggregateFunctionList(node: PartiqlPhysical.AggregateFunctionList) { }
        open fun visitWindowExpression(node: PartiqlPhysical.WindowExpression) { }
        open fun visitPlan(node: PartiqlPhysical.Plan) { }
        open fun visitLocalVariable(node: PartiqlPhysical.LocalVariable) { }
        open fun visitVarDecl(node: PartiqlPhysical.VarDecl) { }
        open fun visitImpl(node: PartiqlPhysical.Impl) { }
        //////////////////////////////////////
        // Sum Type: ExplainTarget
        //////////////////////////////////////
        protected open fun visitExplainTarget(node: PartiqlPhysical.ExplainTarget) { }
        protected open fun visitExplainTargetDomain(node: PartiqlPhysical.ExplainTarget.Domain) { }
        //////////////////////////////////////
        // Sum Type: PathStep
        //////////////////////////////////////
        protected open fun visitPathStep(node: PartiqlPhysical.PathStep) { }
        protected open fun visitPathStepPathExpr(node: PartiqlPhysical.PathStep.PathExpr) { }
        protected open fun visitPathStepPathWildcard(node: PartiqlPhysical.PathStep.PathWildcard) { }
        protected open fun visitPathStepPathUnpivot(node: PartiqlPhysical.PathStep.PathUnpivot) { }
        //////////////////////////////////////
        // Sum Type: JoinType
        //////////////////////////////////////
        protected open fun visitJoinType(node: PartiqlPhysical.JoinType) { }
        protected open fun visitJoinTypeInner(node: PartiqlPhysical.JoinType.Inner) { }
        protected open fun visitJoinTypeLeft(node: PartiqlPhysical.JoinType.Left) { }
        protected open fun visitJoinTypeRight(node: PartiqlPhysical.JoinType.Right) { }
        protected open fun visitJoinTypeFull(node: PartiqlPhysical.JoinType.Full) { }
        //////////////////////////////////////
        // Sum Type: GraphMatchDirection
        //////////////////////////////////////
        protected open fun visitGraphMatchDirection(node: PartiqlPhysical.GraphMatchDirection) { }
        protected open fun visitGraphMatchDirectionEdgeLeft(node: PartiqlPhysical.GraphMatchDirection.EdgeLeft) { }
        protected open fun visitGraphMatchDirectionEdgeUndirected(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirected) { }
        protected open fun visitGraphMatchDirectionEdgeRight(node: PartiqlPhysical.GraphMatchDirection.EdgeRight) { }
        protected open fun visitGraphMatchDirectionEdgeLeftOrUndirected(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected) { }
        protected open fun visitGraphMatchDirectionEdgeUndirectedOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight) { }
        protected open fun visitGraphMatchDirectionEdgeLeftOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight) { }
        protected open fun visitGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight) { }
        //////////////////////////////////////
        // Sum Type: GraphMatchPatternPart
        //////////////////////////////////////
        protected open fun visitGraphMatchPatternPart(node: PartiqlPhysical.GraphMatchPatternPart) { }
        protected open fun visitGraphMatchPatternPartNode(node: PartiqlPhysical.GraphMatchPatternPart.Node) { }
        protected open fun visitGraphMatchPatternPartEdge(node: PartiqlPhysical.GraphMatchPatternPart.Edge) { }
        protected open fun visitGraphMatchPatternPartPattern(node: PartiqlPhysical.GraphMatchPatternPart.Pattern) { }
        //////////////////////////////////////
        // Sum Type: GraphMatchRestrictor
        //////////////////////////////////////
        protected open fun visitGraphMatchRestrictor(node: PartiqlPhysical.GraphMatchRestrictor) { }
        protected open fun visitGraphMatchRestrictorRestrictorTrail(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail) { }
        protected open fun visitGraphMatchRestrictorRestrictorAcyclic(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic) { }
        protected open fun visitGraphMatchRestrictorRestrictorSimple(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple) { }
        //////////////////////////////////////
        // Sum Type: GraphMatchSelector
        //////////////////////////////////////
        protected open fun visitGraphMatchSelector(node: PartiqlPhysical.GraphMatchSelector) { }
        protected open fun visitGraphMatchSelectorSelectorAnyShortest(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest) { }
        protected open fun visitGraphMatchSelectorSelectorAllShortest(node: PartiqlPhysical.GraphMatchSelector.SelectorAllShortest) { }
        protected open fun visitGraphMatchSelectorSelectorAny(node: PartiqlPhysical.GraphMatchSelector.SelectorAny) { }
        protected open fun visitGraphMatchSelectorSelectorAnyK(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyK) { }
        protected open fun visitGraphMatchSelectorSelectorShortestK(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestK) { }
        protected open fun visitGraphMatchSelectorSelectorShortestKGroup(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup) { }
        //////////////////////////////////////
        // Sum Type: GroupingStrategy
        //////////////////////////////////////
        protected open fun visitGroupingStrategy(node: PartiqlPhysical.GroupingStrategy) { }
        protected open fun visitGroupingStrategyGroupFull(node: PartiqlPhysical.GroupingStrategy.GroupFull) { }
        protected open fun visitGroupingStrategyGroupPartial(node: PartiqlPhysical.GroupingStrategy.GroupPartial) { }
        //////////////////////////////////////
        // Sum Type: OrderingSpec
        //////////////////////////////////////
        protected open fun visitOrderingSpec(node: PartiqlPhysical.OrderingSpec) { }
        protected open fun visitOrderingSpecAsc(node: PartiqlPhysical.OrderingSpec.Asc) { }
        protected open fun visitOrderingSpecDesc(node: PartiqlPhysical.OrderingSpec.Desc) { }
        //////////////////////////////////////
        // Sum Type: NullsSpec
        //////////////////////////////////////
        protected open fun visitNullsSpec(node: PartiqlPhysical.NullsSpec) { }
        protected open fun visitNullsSpecNullsFirst(node: PartiqlPhysical.NullsSpec.NullsFirst) { }
        protected open fun visitNullsSpecNullsLast(node: PartiqlPhysical.NullsSpec.NullsLast) { }
        //////////////////////////////////////
        // Sum Type: CaseSensitivity
        //////////////////////////////////////
        protected open fun visitCaseSensitivity(node: PartiqlPhysical.CaseSensitivity) { }
        protected open fun visitCaseSensitivityCaseSensitive(node: PartiqlPhysical.CaseSensitivity.CaseSensitive) { }
        protected open fun visitCaseSensitivityCaseInsensitive(node: PartiqlPhysical.CaseSensitivity.CaseInsensitive) { }
        //////////////////////////////////////
        // Sum Type: SetQuantifier
        //////////////////////////////////////
        protected open fun visitSetQuantifier(node: PartiqlPhysical.SetQuantifier) { }
        protected open fun visitSetQuantifierAll(node: PartiqlPhysical.SetQuantifier.All) { }
        protected open fun visitSetQuantifierDistinct(node: PartiqlPhysical.SetQuantifier.Distinct) { }
        //////////////////////////////////////
        // Sum Type: BagOpType
        //////////////////////////////////////
        protected open fun visitBagOpType(node: PartiqlPhysical.BagOpType) { }
        protected open fun visitBagOpTypeUnion(node: PartiqlPhysical.BagOpType.Union) { }
        protected open fun visitBagOpTypeIntersect(node: PartiqlPhysical.BagOpType.Intersect) { }
        protected open fun visitBagOpTypeExcept(node: PartiqlPhysical.BagOpType.Except) { }
        protected open fun visitBagOpTypeOuterUnion(node: PartiqlPhysical.BagOpType.OuterUnion) { }
        protected open fun visitBagOpTypeOuterIntersect(node: PartiqlPhysical.BagOpType.OuterIntersect) { }
        protected open fun visitBagOpTypeOuterExcept(node: PartiqlPhysical.BagOpType.OuterExcept) { }
        //////////////////////////////////////
        // Sum Type: OnConflictValue
        //////////////////////////////////////
        protected open fun visitOnConflictValue(node: PartiqlPhysical.OnConflictValue) { }
        protected open fun visitOnConflictValueExcluded(node: PartiqlPhysical.OnConflictValue.Excluded) { }
        //////////////////////////////////////
        // Sum Type: Type
        //////////////////////////////////////
        protected open fun visitType(node: PartiqlPhysical.Type) { }
        protected open fun visitTypeNullType(node: PartiqlPhysical.Type.NullType) { }
        protected open fun visitTypeBooleanType(node: PartiqlPhysical.Type.BooleanType) { }
        protected open fun visitTypeSmallintType(node: PartiqlPhysical.Type.SmallintType) { }
        protected open fun visitTypeInteger4Type(node: PartiqlPhysical.Type.Integer4Type) { }
        protected open fun visitTypeInteger8Type(node: PartiqlPhysical.Type.Integer8Type) { }
        protected open fun visitTypeIntegerType(node: PartiqlPhysical.Type.IntegerType) { }
        protected open fun visitTypeFloatType(node: PartiqlPhysical.Type.FloatType) { }
        protected open fun visitTypeRealType(node: PartiqlPhysical.Type.RealType) { }
        protected open fun visitTypeDoublePrecisionType(node: PartiqlPhysical.Type.DoublePrecisionType) { }
        protected open fun visitTypeDecimalType(node: PartiqlPhysical.Type.DecimalType) { }
        protected open fun visitTypeNumericType(node: PartiqlPhysical.Type.NumericType) { }
        protected open fun visitTypeTimestampType(node: PartiqlPhysical.Type.TimestampType) { }
        protected open fun visitTypeCharacterType(node: PartiqlPhysical.Type.CharacterType) { }
        protected open fun visitTypeCharacterVaryingType(node: PartiqlPhysical.Type.CharacterVaryingType) { }
        protected open fun visitTypeMissingType(node: PartiqlPhysical.Type.MissingType) { }
        protected open fun visitTypeStringType(node: PartiqlPhysical.Type.StringType) { }
        protected open fun visitTypeSymbolType(node: PartiqlPhysical.Type.SymbolType) { }
        protected open fun visitTypeBlobType(node: PartiqlPhysical.Type.BlobType) { }
        protected open fun visitTypeClobType(node: PartiqlPhysical.Type.ClobType) { }
        protected open fun visitTypeDateType(node: PartiqlPhysical.Type.DateType) { }
        protected open fun visitTypeTimeType(node: PartiqlPhysical.Type.TimeType) { }
        protected open fun visitTypeTimeWithTimeZoneType(node: PartiqlPhysical.Type.TimeWithTimeZoneType) { }
        protected open fun visitTypeStructType(node: PartiqlPhysical.Type.StructType) { }
        protected open fun visitTypeTupleType(node: PartiqlPhysical.Type.TupleType) { }
        protected open fun visitTypeListType(node: PartiqlPhysical.Type.ListType) { }
        protected open fun visitTypeSexpType(node: PartiqlPhysical.Type.SexpType) { }
        protected open fun visitTypeBagType(node: PartiqlPhysical.Type.BagType) { }
        protected open fun visitTypeAnyType(node: PartiqlPhysical.Type.AnyType) { }
        protected open fun visitTypeCustomType(node: PartiqlPhysical.Type.CustomType) { }
        //////////////////////////////////////
        // Sum Type: StructPart
        //////////////////////////////////////
        protected open fun visitStructPart(node: PartiqlPhysical.StructPart) { }
        protected open fun visitStructPartStructFields(node: PartiqlPhysical.StructPart.StructFields) { }
        protected open fun visitStructPartStructField(node: PartiqlPhysical.StructPart.StructField) { }
        //////////////////////////////////////
        // Sum Type: Expr
        //////////////////////////////////////
        protected open fun visitExpr(node: PartiqlPhysical.Expr) { }
        protected open fun visitExprMissing(node: PartiqlPhysical.Expr.Missing) { }
        protected open fun visitExprLit(node: PartiqlPhysical.Expr.Lit) { }
        protected open fun visitExprParameter(node: PartiqlPhysical.Expr.Parameter) { }
        protected open fun visitExprNot(node: PartiqlPhysical.Expr.Not) { }
        protected open fun visitExprPos(node: PartiqlPhysical.Expr.Pos) { }
        protected open fun visitExprNeg(node: PartiqlPhysical.Expr.Neg) { }
        protected open fun visitExprPlus(node: PartiqlPhysical.Expr.Plus) { }
        protected open fun visitExprMinus(node: PartiqlPhysical.Expr.Minus) { }
        protected open fun visitExprTimes(node: PartiqlPhysical.Expr.Times) { }
        protected open fun visitExprDivide(node: PartiqlPhysical.Expr.Divide) { }
        protected open fun visitExprModulo(node: PartiqlPhysical.Expr.Modulo) { }
        protected open fun visitExprConcat(node: PartiqlPhysical.Expr.Concat) { }
        protected open fun visitExprAnd(node: PartiqlPhysical.Expr.And) { }
        protected open fun visitExprOr(node: PartiqlPhysical.Expr.Or) { }
        protected open fun visitExprEq(node: PartiqlPhysical.Expr.Eq) { }
        protected open fun visitExprNe(node: PartiqlPhysical.Expr.Ne) { }
        protected open fun visitExprGt(node: PartiqlPhysical.Expr.Gt) { }
        protected open fun visitExprGte(node: PartiqlPhysical.Expr.Gte) { }
        protected open fun visitExprLt(node: PartiqlPhysical.Expr.Lt) { }
        protected open fun visitExprLte(node: PartiqlPhysical.Expr.Lte) { }
        protected open fun visitExprLike(node: PartiqlPhysical.Expr.Like) { }
        protected open fun visitExprBetween(node: PartiqlPhysical.Expr.Between) { }
        protected open fun visitExprInCollection(node: PartiqlPhysical.Expr.InCollection) { }
        protected open fun visitExprIsType(node: PartiqlPhysical.Expr.IsType) { }
        protected open fun visitExprSimpleCase(node: PartiqlPhysical.Expr.SimpleCase) { }
        protected open fun visitExprSearchedCase(node: PartiqlPhysical.Expr.SearchedCase) { }
        protected open fun visitExprBag(node: PartiqlPhysical.Expr.Bag) { }
        protected open fun visitExprList(node: PartiqlPhysical.Expr.List) { }
        protected open fun visitExprSexp(node: PartiqlPhysical.Expr.Sexp) { }
        protected open fun visitExprDate(node: PartiqlPhysical.Expr.Date) { }
        protected open fun visitExprLitTime(node: PartiqlPhysical.Expr.LitTime) { }
        protected open fun visitExprBagOp(node: PartiqlPhysical.Expr.BagOp) { }
        protected open fun visitExprGraphMatch(node: PartiqlPhysical.Expr.GraphMatch) { }
        protected open fun visitExprPath(node: PartiqlPhysical.Expr.Path) { }
        protected open fun visitExprCall(node: PartiqlPhysical.Expr.Call) { }
        protected open fun visitExprCast(node: PartiqlPhysical.Expr.Cast) { }
        protected open fun visitExprCanCast(node: PartiqlPhysical.Expr.CanCast) { }
        protected open fun visitExprCanLosslessCast(node: PartiqlPhysical.Expr.CanLosslessCast) { }
        protected open fun visitExprNullIf(node: PartiqlPhysical.Expr.NullIf) { }
        protected open fun visitExprCoalesce(node: PartiqlPhysical.Expr.Coalesce) { }
        protected open fun visitExprBindingsToValues(node: PartiqlPhysical.Expr.BindingsToValues) { }
        protected open fun visitExprStruct(node: PartiqlPhysical.Expr.Struct) { }
        protected open fun visitExprPivot(node: PartiqlPhysical.Expr.Pivot) { }
        protected open fun visitExprLocalId(node: PartiqlPhysical.Expr.LocalId) { }
        protected open fun visitExprGlobalId(node: PartiqlPhysical.Expr.GlobalId) { }
        //////////////////////////////////////
        // Sum Type: Statement
        //////////////////////////////////////
        protected open fun visitStatement(node: PartiqlPhysical.Statement) { }
        protected open fun visitStatementQuery(node: PartiqlPhysical.Statement.Query) { }
        protected open fun visitStatementExec(node: PartiqlPhysical.Statement.Exec) { }
        protected open fun visitStatementExplain(node: PartiqlPhysical.Statement.Explain) { }
        protected open fun visitStatementDmlQuery(node: PartiqlPhysical.Statement.DmlQuery) { }
        //////////////////////////////////////
        // Sum Type: Bexpr
        //////////////////////////////////////
        protected open fun visitBexpr(node: PartiqlPhysical.Bexpr) { }
        protected open fun visitBexprProject(node: PartiqlPhysical.Bexpr.Project) { }
        protected open fun visitBexprScan(node: PartiqlPhysical.Bexpr.Scan) { }
        protected open fun visitBexprUnpivot(node: PartiqlPhysical.Bexpr.Unpivot) { }
        protected open fun visitBexprFilter(node: PartiqlPhysical.Bexpr.Filter) { }
        protected open fun visitBexprJoin(node: PartiqlPhysical.Bexpr.Join) { }
        protected open fun visitBexprSort(node: PartiqlPhysical.Bexpr.Sort) { }
        protected open fun visitBexprAggregate(node: PartiqlPhysical.Bexpr.Aggregate) { }
        protected open fun visitBexprOffset(node: PartiqlPhysical.Bexpr.Offset) { }
        protected open fun visitBexprLimit(node: PartiqlPhysical.Bexpr.Limit) { }
        protected open fun visitBexprLet(node: PartiqlPhysical.Bexpr.Let) { }
        protected open fun visitBexprWindow(node: PartiqlPhysical.Bexpr.Window) { }
    
        ////////////////////////////////////////////////////////////////////////////
        // Walk Functions
        ////////////////////////////////////////////////////////////////////////////
    
        //////////////////////////////////////
        // Tuple Types
        //////////////////////////////////////
        open fun walkTimeValue(node: PartiqlPhysical.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 walkGraphMatchQuantifier(node: PartiqlPhysical.GraphMatchQuantifier) {
            visitGraphMatchQuantifier(node)
            walkLongPrimitive(node.lower)
            node.upper?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
    
        open fun walkGraphMatchPattern(node: PartiqlPhysical.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: PartiqlPhysical.GpmlPattern) {
            visitGpmlPattern(node)
            node.selector?.let { walkGraphMatchSelector(it) }
            node.patterns.map { walkGraphMatchPattern(it) }
            walkMetas(node.metas)
        }
    
        open fun walkExprPair(node: PartiqlPhysical.ExprPair) {
            visitExprPair(node)
            walkExpr(node.first)
            walkExpr(node.second)
            walkMetas(node.metas)
        }
    
        open fun walkExprPairList(node: PartiqlPhysical.ExprPairList) {
            visitExprPairList(node)
            node.pairs.map { walkExprPair(it) }
            walkMetas(node.metas)
        }
    
        open fun walkSortSpec(node: PartiqlPhysical.SortSpec) {
            visitSortSpec(node)
            walkExpr(node.expr)
            node.orderingSpec?.let { walkOrderingSpec(it) }
            node.nullsSpec?.let { walkNullsSpec(it) }
            walkMetas(node.metas)
        }
    
        open fun walkOver(node: PartiqlPhysical.Over) {
            visitOver(node)
            node.partitionBy?.let { walkWindowPartitionList(it) }
            node.orderBy?.let { walkWindowSortSpecList(it) }
            walkMetas(node.metas)
        }
    
        open fun walkWindowPartitionList(node: PartiqlPhysical.WindowPartitionList) {
            visitWindowPartitionList(node)
            node.exprs.map { walkExpr(it) }
            walkMetas(node.metas)
        }
    
        open fun walkWindowSortSpecList(node: PartiqlPhysical.WindowSortSpecList) {
            visitWindowSortSpecList(node)
            node.sortSpecs.map { walkSortSpec(it) }
            walkMetas(node.metas)
        }
    
        open fun walkIdentifier(node: PartiqlPhysical.Identifier) {
            visitIdentifier(node)
            walkSymbolPrimitive(node.name)
            walkCaseSensitivity(node.case)
            walkMetas(node.metas)
        }
    
        open fun walkLetBinding(node: PartiqlPhysical.LetBinding) {
            visitLetBinding(node)
            walkExpr(node.value)
            walkVarDecl(node.decl)
            walkMetas(node.metas)
        }
    
        open fun walkGroupKey(node: PartiqlPhysical.GroupKey) {
            visitGroupKey(node)
            walkExpr(node.expr)
            walkVarDecl(node.asVar)
            walkMetas(node.metas)
        }
    
        open fun walkGroupKeyList(node: PartiqlPhysical.GroupKeyList) {
            visitGroupKeyList(node)
            node.keys.map { walkGroupKey(it) }
            walkMetas(node.metas)
        }
    
        open fun walkAggregateFunction(node: PartiqlPhysical.AggregateFunction) {
            visitAggregateFunction(node)
            walkSetQuantifier(node.quantifier)
            walkSymbolPrimitive(node.name)
            walkExpr(node.arg)
            walkVarDecl(node.asVar)
            walkMetas(node.metas)
        }
    
        open fun walkAggregateFunctionList(node: PartiqlPhysical.AggregateFunctionList) {
            visitAggregateFunctionList(node)
            node.functions.map { walkAggregateFunction(it) }
            walkMetas(node.metas)
        }
    
        open fun walkWindowExpression(node: PartiqlPhysical.WindowExpression) {
            visitWindowExpression(node)
            walkVarDecl(node.decl)
            walkSymbolPrimitive(node.funcName)
            node.args.map { walkExpr(it) }
            walkMetas(node.metas)
        }
    
        open fun walkPlan(node: PartiqlPhysical.Plan) {
            visitPlan(node)
            walkStatement(node.stmt)
            walkSymbolPrimitive(node.version)
            node.locals.map { walkLocalVariable(it) }
            walkMetas(node.metas)
        }
    
        open fun walkLocalVariable(node: PartiqlPhysical.LocalVariable) {
            visitLocalVariable(node)
            walkSymbolPrimitive(node.name)
            walkLongPrimitive(node.registerIndex)
            walkMetas(node.metas)
        }
    
        open fun walkVarDecl(node: PartiqlPhysical.VarDecl) {
            visitVarDecl(node)
            walkLongPrimitive(node.index)
            walkMetas(node.metas)
        }
    
        open fun walkImpl(node: PartiqlPhysical.Impl) {
            visitImpl(node)
            walkSymbolPrimitive(node.name)
            node.staticArgs.map { walkAnyElement(it) }
            walkMetas(node.metas)
        }
    
        //////////////////////////////////////
        // Sum Type: ExplainTarget
        //////////////////////////////////////
        open fun walkExplainTarget(node: PartiqlPhysical.ExplainTarget) {
            visitExplainTarget(node)
            when(node) {
                is PartiqlPhysical.ExplainTarget.Domain -> walkExplainTargetDomain(node)
            }
        }
    
        open fun walkExplainTargetDomain(node: PartiqlPhysical.ExplainTarget.Domain) {
            visitExplainTargetDomain(node)
            walkStatement(node.statement)
            node.type?.let { walkSymbolPrimitive(it) }
            node.format?.let { walkSymbolPrimitive(it) }
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: PathStep
        //////////////////////////////////////
        open fun walkPathStep(node: PartiqlPhysical.PathStep) {
            visitPathStep(node)
            when(node) {
                is PartiqlPhysical.PathStep.PathExpr -> walkPathStepPathExpr(node)
                is PartiqlPhysical.PathStep.PathWildcard -> walkPathStepPathWildcard(node)
                is PartiqlPhysical.PathStep.PathUnpivot -> walkPathStepPathUnpivot(node)
            }
        }
    
        open fun walkPathStepPathExpr(node: PartiqlPhysical.PathStep.PathExpr) {
            visitPathStepPathExpr(node)
            walkExpr(node.index)
            walkCaseSensitivity(node.case)
            walkMetas(node.metas)
        }
        open fun walkPathStepPathWildcard(node: PartiqlPhysical.PathStep.PathWildcard) {
            visitPathStepPathWildcard(node)
            walkMetas(node.metas)
        }
        open fun walkPathStepPathUnpivot(node: PartiqlPhysical.PathStep.PathUnpivot) {
            visitPathStepPathUnpivot(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: JoinType
        //////////////////////////////////////
        open fun walkJoinType(node: PartiqlPhysical.JoinType) {
            visitJoinType(node)
            when(node) {
                is PartiqlPhysical.JoinType.Inner -> walkJoinTypeInner(node)
                is PartiqlPhysical.JoinType.Left -> walkJoinTypeLeft(node)
                is PartiqlPhysical.JoinType.Right -> walkJoinTypeRight(node)
                is PartiqlPhysical.JoinType.Full -> walkJoinTypeFull(node)
            }
        }
    
        open fun walkJoinTypeInner(node: PartiqlPhysical.JoinType.Inner) {
            visitJoinTypeInner(node)
            walkMetas(node.metas)
        }
        open fun walkJoinTypeLeft(node: PartiqlPhysical.JoinType.Left) {
            visitJoinTypeLeft(node)
            walkMetas(node.metas)
        }
        open fun walkJoinTypeRight(node: PartiqlPhysical.JoinType.Right) {
            visitJoinTypeRight(node)
            walkMetas(node.metas)
        }
        open fun walkJoinTypeFull(node: PartiqlPhysical.JoinType.Full) {
            visitJoinTypeFull(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: GraphMatchDirection
        //////////////////////////////////////
        open fun walkGraphMatchDirection(node: PartiqlPhysical.GraphMatchDirection) {
            visitGraphMatchDirection(node)
            when(node) {
                is PartiqlPhysical.GraphMatchDirection.EdgeLeft -> walkGraphMatchDirectionEdgeLeft(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeUndirected -> walkGraphMatchDirectionEdgeUndirected(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeRight -> walkGraphMatchDirectionEdgeRight(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected -> walkGraphMatchDirectionEdgeLeftOrUndirected(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight -> walkGraphMatchDirectionEdgeUndirectedOrRight(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight -> walkGraphMatchDirectionEdgeLeftOrRight(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight -> walkGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node)
            }
        }
    
        open fun walkGraphMatchDirectionEdgeLeft(node: PartiqlPhysical.GraphMatchDirection.EdgeLeft) {
            visitGraphMatchDirectionEdgeLeft(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchDirectionEdgeUndirected(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirected) {
            visitGraphMatchDirectionEdgeUndirected(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchDirectionEdgeRight(node: PartiqlPhysical.GraphMatchDirection.EdgeRight) {
            visitGraphMatchDirectionEdgeRight(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchDirectionEdgeLeftOrUndirected(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected) {
            visitGraphMatchDirectionEdgeLeftOrUndirected(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchDirectionEdgeUndirectedOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight) {
            visitGraphMatchDirectionEdgeUndirectedOrRight(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchDirectionEdgeLeftOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight) {
            visitGraphMatchDirectionEdgeLeftOrRight(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight) {
            visitGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: GraphMatchPatternPart
        //////////////////////////////////////
        open fun walkGraphMatchPatternPart(node: PartiqlPhysical.GraphMatchPatternPart) {
            visitGraphMatchPatternPart(node)
            when(node) {
                is PartiqlPhysical.GraphMatchPatternPart.Node -> walkGraphMatchPatternPartNode(node)
                is PartiqlPhysical.GraphMatchPatternPart.Edge -> walkGraphMatchPatternPartEdge(node)
                is PartiqlPhysical.GraphMatchPatternPart.Pattern -> walkGraphMatchPatternPartPattern(node)
            }
        }
    
        open fun walkGraphMatchPatternPartNode(node: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.GraphMatchPatternPart.Pattern) {
            visitGraphMatchPatternPartPattern(node)
            walkGraphMatchPattern(node.pattern)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: GraphMatchRestrictor
        //////////////////////////////////////
        open fun walkGraphMatchRestrictor(node: PartiqlPhysical.GraphMatchRestrictor) {
            visitGraphMatchRestrictor(node)
            when(node) {
                is PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail -> walkGraphMatchRestrictorRestrictorTrail(node)
                is PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic -> walkGraphMatchRestrictorRestrictorAcyclic(node)
                is PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple -> walkGraphMatchRestrictorRestrictorSimple(node)
            }
        }
    
        open fun walkGraphMatchRestrictorRestrictorTrail(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail) {
            visitGraphMatchRestrictorRestrictorTrail(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchRestrictorRestrictorAcyclic(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic) {
            visitGraphMatchRestrictorRestrictorAcyclic(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchRestrictorRestrictorSimple(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple) {
            visitGraphMatchRestrictorRestrictorSimple(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: GraphMatchSelector
        //////////////////////////////////////
        open fun walkGraphMatchSelector(node: PartiqlPhysical.GraphMatchSelector) {
            visitGraphMatchSelector(node)
            when(node) {
                is PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest -> walkGraphMatchSelectorSelectorAnyShortest(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorAllShortest -> walkGraphMatchSelectorSelectorAllShortest(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorAny -> walkGraphMatchSelectorSelectorAny(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorAnyK -> walkGraphMatchSelectorSelectorAnyK(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorShortestK -> walkGraphMatchSelectorSelectorShortestK(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup -> walkGraphMatchSelectorSelectorShortestKGroup(node)
            }
        }
    
        open fun walkGraphMatchSelectorSelectorAnyShortest(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest) {
            visitGraphMatchSelectorSelectorAnyShortest(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchSelectorSelectorAllShortest(node: PartiqlPhysical.GraphMatchSelector.SelectorAllShortest) {
            visitGraphMatchSelectorSelectorAllShortest(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchSelectorSelectorAny(node: PartiqlPhysical.GraphMatchSelector.SelectorAny) {
            visitGraphMatchSelectorSelectorAny(node)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchSelectorSelectorAnyK(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyK) {
            visitGraphMatchSelectorSelectorAnyK(node)
            walkLongPrimitive(node.k)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchSelectorSelectorShortestK(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestK) {
            visitGraphMatchSelectorSelectorShortestK(node)
            walkLongPrimitive(node.k)
            walkMetas(node.metas)
        }
        open fun walkGraphMatchSelectorSelectorShortestKGroup(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup) {
            visitGraphMatchSelectorSelectorShortestKGroup(node)
            walkLongPrimitive(node.k)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: GroupingStrategy
        //////////////////////////////////////
        open fun walkGroupingStrategy(node: PartiqlPhysical.GroupingStrategy) {
            visitGroupingStrategy(node)
            when(node) {
                is PartiqlPhysical.GroupingStrategy.GroupFull -> walkGroupingStrategyGroupFull(node)
                is PartiqlPhysical.GroupingStrategy.GroupPartial -> walkGroupingStrategyGroupPartial(node)
            }
        }
    
        open fun walkGroupingStrategyGroupFull(node: PartiqlPhysical.GroupingStrategy.GroupFull) {
            visitGroupingStrategyGroupFull(node)
            walkMetas(node.metas)
        }
        open fun walkGroupingStrategyGroupPartial(node: PartiqlPhysical.GroupingStrategy.GroupPartial) {
            visitGroupingStrategyGroupPartial(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: OrderingSpec
        //////////////////////////////////////
        open fun walkOrderingSpec(node: PartiqlPhysical.OrderingSpec) {
            visitOrderingSpec(node)
            when(node) {
                is PartiqlPhysical.OrderingSpec.Asc -> walkOrderingSpecAsc(node)
                is PartiqlPhysical.OrderingSpec.Desc -> walkOrderingSpecDesc(node)
            }
        }
    
        open fun walkOrderingSpecAsc(node: PartiqlPhysical.OrderingSpec.Asc) {
            visitOrderingSpecAsc(node)
            walkMetas(node.metas)
        }
        open fun walkOrderingSpecDesc(node: PartiqlPhysical.OrderingSpec.Desc) {
            visitOrderingSpecDesc(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: NullsSpec
        //////////////////////////////////////
        open fun walkNullsSpec(node: PartiqlPhysical.NullsSpec) {
            visitNullsSpec(node)
            when(node) {
                is PartiqlPhysical.NullsSpec.NullsFirst -> walkNullsSpecNullsFirst(node)
                is PartiqlPhysical.NullsSpec.NullsLast -> walkNullsSpecNullsLast(node)
            }
        }
    
        open fun walkNullsSpecNullsFirst(node: PartiqlPhysical.NullsSpec.NullsFirst) {
            visitNullsSpecNullsFirst(node)
            walkMetas(node.metas)
        }
        open fun walkNullsSpecNullsLast(node: PartiqlPhysical.NullsSpec.NullsLast) {
            visitNullsSpecNullsLast(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: CaseSensitivity
        //////////////////////////////////////
        open fun walkCaseSensitivity(node: PartiqlPhysical.CaseSensitivity) {
            visitCaseSensitivity(node)
            when(node) {
                is PartiqlPhysical.CaseSensitivity.CaseSensitive -> walkCaseSensitivityCaseSensitive(node)
                is PartiqlPhysical.CaseSensitivity.CaseInsensitive -> walkCaseSensitivityCaseInsensitive(node)
            }
        }
    
        open fun walkCaseSensitivityCaseSensitive(node: PartiqlPhysical.CaseSensitivity.CaseSensitive) {
            visitCaseSensitivityCaseSensitive(node)
            walkMetas(node.metas)
        }
        open fun walkCaseSensitivityCaseInsensitive(node: PartiqlPhysical.CaseSensitivity.CaseInsensitive) {
            visitCaseSensitivityCaseInsensitive(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: SetQuantifier
        //////////////////////////////////////
        open fun walkSetQuantifier(node: PartiqlPhysical.SetQuantifier) {
            visitSetQuantifier(node)
            when(node) {
                is PartiqlPhysical.SetQuantifier.All -> walkSetQuantifierAll(node)
                is PartiqlPhysical.SetQuantifier.Distinct -> walkSetQuantifierDistinct(node)
            }
        }
    
        open fun walkSetQuantifierAll(node: PartiqlPhysical.SetQuantifier.All) {
            visitSetQuantifierAll(node)
            walkMetas(node.metas)
        }
        open fun walkSetQuantifierDistinct(node: PartiqlPhysical.SetQuantifier.Distinct) {
            visitSetQuantifierDistinct(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: BagOpType
        //////////////////////////////////////
        open fun walkBagOpType(node: PartiqlPhysical.BagOpType) {
            visitBagOpType(node)
            when(node) {
                is PartiqlPhysical.BagOpType.Union -> walkBagOpTypeUnion(node)
                is PartiqlPhysical.BagOpType.Intersect -> walkBagOpTypeIntersect(node)
                is PartiqlPhysical.BagOpType.Except -> walkBagOpTypeExcept(node)
                is PartiqlPhysical.BagOpType.OuterUnion -> walkBagOpTypeOuterUnion(node)
                is PartiqlPhysical.BagOpType.OuterIntersect -> walkBagOpTypeOuterIntersect(node)
                is PartiqlPhysical.BagOpType.OuterExcept -> walkBagOpTypeOuterExcept(node)
            }
        }
    
        open fun walkBagOpTypeUnion(node: PartiqlPhysical.BagOpType.Union) {
            visitBagOpTypeUnion(node)
            walkMetas(node.metas)
        }
        open fun walkBagOpTypeIntersect(node: PartiqlPhysical.BagOpType.Intersect) {
            visitBagOpTypeIntersect(node)
            walkMetas(node.metas)
        }
        open fun walkBagOpTypeExcept(node: PartiqlPhysical.BagOpType.Except) {
            visitBagOpTypeExcept(node)
            walkMetas(node.metas)
        }
        open fun walkBagOpTypeOuterUnion(node: PartiqlPhysical.BagOpType.OuterUnion) {
            visitBagOpTypeOuterUnion(node)
            walkMetas(node.metas)
        }
        open fun walkBagOpTypeOuterIntersect(node: PartiqlPhysical.BagOpType.OuterIntersect) {
            visitBagOpTypeOuterIntersect(node)
            walkMetas(node.metas)
        }
        open fun walkBagOpTypeOuterExcept(node: PartiqlPhysical.BagOpType.OuterExcept) {
            visitBagOpTypeOuterExcept(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: OnConflictValue
        //////////////////////////////////////
        open fun walkOnConflictValue(node: PartiqlPhysical.OnConflictValue) {
            visitOnConflictValue(node)
            when(node) {
                is PartiqlPhysical.OnConflictValue.Excluded -> walkOnConflictValueExcluded(node)
            }
        }
    
        open fun walkOnConflictValueExcluded(node: PartiqlPhysical.OnConflictValue.Excluded) {
            visitOnConflictValueExcluded(node)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: Type
        //////////////////////////////////////
        open fun walkType(node: PartiqlPhysical.Type) {
            visitType(node)
            when(node) {
                is PartiqlPhysical.Type.NullType -> walkTypeNullType(node)
                is PartiqlPhysical.Type.BooleanType -> walkTypeBooleanType(node)
                is PartiqlPhysical.Type.SmallintType -> walkTypeSmallintType(node)
                is PartiqlPhysical.Type.Integer4Type -> walkTypeInteger4Type(node)
                is PartiqlPhysical.Type.Integer8Type -> walkTypeInteger8Type(node)
                is PartiqlPhysical.Type.IntegerType -> walkTypeIntegerType(node)
                is PartiqlPhysical.Type.FloatType -> walkTypeFloatType(node)
                is PartiqlPhysical.Type.RealType -> walkTypeRealType(node)
                is PartiqlPhysical.Type.DoublePrecisionType -> walkTypeDoublePrecisionType(node)
                is PartiqlPhysical.Type.DecimalType -> walkTypeDecimalType(node)
                is PartiqlPhysical.Type.NumericType -> walkTypeNumericType(node)
                is PartiqlPhysical.Type.TimestampType -> walkTypeTimestampType(node)
                is PartiqlPhysical.Type.CharacterType -> walkTypeCharacterType(node)
                is PartiqlPhysical.Type.CharacterVaryingType -> walkTypeCharacterVaryingType(node)
                is PartiqlPhysical.Type.MissingType -> walkTypeMissingType(node)
                is PartiqlPhysical.Type.StringType -> walkTypeStringType(node)
                is PartiqlPhysical.Type.SymbolType -> walkTypeSymbolType(node)
                is PartiqlPhysical.Type.BlobType -> walkTypeBlobType(node)
                is PartiqlPhysical.Type.ClobType -> walkTypeClobType(node)
                is PartiqlPhysical.Type.DateType -> walkTypeDateType(node)
                is PartiqlPhysical.Type.TimeType -> walkTypeTimeType(node)
                is PartiqlPhysical.Type.TimeWithTimeZoneType -> walkTypeTimeWithTimeZoneType(node)
                is PartiqlPhysical.Type.StructType -> walkTypeStructType(node)
                is PartiqlPhysical.Type.TupleType -> walkTypeTupleType(node)
                is PartiqlPhysical.Type.ListType -> walkTypeListType(node)
                is PartiqlPhysical.Type.SexpType -> walkTypeSexpType(node)
                is PartiqlPhysical.Type.BagType -> walkTypeBagType(node)
                is PartiqlPhysical.Type.AnyType -> walkTypeAnyType(node)
                is PartiqlPhysical.Type.CustomType -> walkTypeCustomType(node)
            }
        }
    
        open fun walkTypeNullType(node: PartiqlPhysical.Type.NullType) {
            visitTypeNullType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeBooleanType(node: PartiqlPhysical.Type.BooleanType) {
            visitTypeBooleanType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeSmallintType(node: PartiqlPhysical.Type.SmallintType) {
            visitTypeSmallintType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeInteger4Type(node: PartiqlPhysical.Type.Integer4Type) {
            visitTypeInteger4Type(node)
            walkMetas(node.metas)
        }
        open fun walkTypeInteger8Type(node: PartiqlPhysical.Type.Integer8Type) {
            visitTypeInteger8Type(node)
            walkMetas(node.metas)
        }
        open fun walkTypeIntegerType(node: PartiqlPhysical.Type.IntegerType) {
            visitTypeIntegerType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeFloatType(node: PartiqlPhysical.Type.FloatType) {
            visitTypeFloatType(node)
            node.precision?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeRealType(node: PartiqlPhysical.Type.RealType) {
            visitTypeRealType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeDoublePrecisionType(node: PartiqlPhysical.Type.DoublePrecisionType) {
            visitTypeDoublePrecisionType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeDecimalType(node: PartiqlPhysical.Type.DecimalType) {
            visitTypeDecimalType(node)
            node.precision?.let { walkLongPrimitive(it) }
            node.scale?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeNumericType(node: PartiqlPhysical.Type.NumericType) {
            visitTypeNumericType(node)
            node.precision?.let { walkLongPrimitive(it) }
            node.scale?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeTimestampType(node: PartiqlPhysical.Type.TimestampType) {
            visitTypeTimestampType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeCharacterType(node: PartiqlPhysical.Type.CharacterType) {
            visitTypeCharacterType(node)
            node.length?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeCharacterVaryingType(node: PartiqlPhysical.Type.CharacterVaryingType) {
            visitTypeCharacterVaryingType(node)
            node.length?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeMissingType(node: PartiqlPhysical.Type.MissingType) {
            visitTypeMissingType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeStringType(node: PartiqlPhysical.Type.StringType) {
            visitTypeStringType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeSymbolType(node: PartiqlPhysical.Type.SymbolType) {
            visitTypeSymbolType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeBlobType(node: PartiqlPhysical.Type.BlobType) {
            visitTypeBlobType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeClobType(node: PartiqlPhysical.Type.ClobType) {
            visitTypeClobType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeDateType(node: PartiqlPhysical.Type.DateType) {
            visitTypeDateType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeTimeType(node: PartiqlPhysical.Type.TimeType) {
            visitTypeTimeType(node)
            node.precision?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeTimeWithTimeZoneType(node: PartiqlPhysical.Type.TimeWithTimeZoneType) {
            visitTypeTimeWithTimeZoneType(node)
            node.precision?.let { walkLongPrimitive(it) }
            walkMetas(node.metas)
        }
        open fun walkTypeStructType(node: PartiqlPhysical.Type.StructType) {
            visitTypeStructType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeTupleType(node: PartiqlPhysical.Type.TupleType) {
            visitTypeTupleType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeListType(node: PartiqlPhysical.Type.ListType) {
            visitTypeListType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeSexpType(node: PartiqlPhysical.Type.SexpType) {
            visitTypeSexpType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeBagType(node: PartiqlPhysical.Type.BagType) {
            visitTypeBagType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeAnyType(node: PartiqlPhysical.Type.AnyType) {
            visitTypeAnyType(node)
            walkMetas(node.metas)
        }
        open fun walkTypeCustomType(node: PartiqlPhysical.Type.CustomType) {
            visitTypeCustomType(node)
            walkSymbolPrimitive(node.name)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: StructPart
        //////////////////////////////////////
        open fun walkStructPart(node: PartiqlPhysical.StructPart) {
            visitStructPart(node)
            when(node) {
                is PartiqlPhysical.StructPart.StructFields -> walkStructPartStructFields(node)
                is PartiqlPhysical.StructPart.StructField -> walkStructPartStructField(node)
            }
        }
    
        open fun walkStructPartStructFields(node: PartiqlPhysical.StructPart.StructFields) {
            visitStructPartStructFields(node)
            walkExpr(node.partExpr)
            walkMetas(node.metas)
        }
        open fun walkStructPartStructField(node: PartiqlPhysical.StructPart.StructField) {
            visitStructPartStructField(node)
            walkExpr(node.fieldName)
            walkExpr(node.value)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: Expr
        //////////////////////////////////////
        open fun walkExpr(node: PartiqlPhysical.Expr) {
            visitExpr(node)
            when(node) {
                is PartiqlPhysical.Expr.Missing -> walkExprMissing(node)
                is PartiqlPhysical.Expr.Lit -> walkExprLit(node)
                is PartiqlPhysical.Expr.Parameter -> walkExprParameter(node)
                is PartiqlPhysical.Expr.Not -> walkExprNot(node)
                is PartiqlPhysical.Expr.Pos -> walkExprPos(node)
                is PartiqlPhysical.Expr.Neg -> walkExprNeg(node)
                is PartiqlPhysical.Expr.Plus -> walkExprPlus(node)
                is PartiqlPhysical.Expr.Minus -> walkExprMinus(node)
                is PartiqlPhysical.Expr.Times -> walkExprTimes(node)
                is PartiqlPhysical.Expr.Divide -> walkExprDivide(node)
                is PartiqlPhysical.Expr.Modulo -> walkExprModulo(node)
                is PartiqlPhysical.Expr.Concat -> walkExprConcat(node)
                is PartiqlPhysical.Expr.And -> walkExprAnd(node)
                is PartiqlPhysical.Expr.Or -> walkExprOr(node)
                is PartiqlPhysical.Expr.Eq -> walkExprEq(node)
                is PartiqlPhysical.Expr.Ne -> walkExprNe(node)
                is PartiqlPhysical.Expr.Gt -> walkExprGt(node)
                is PartiqlPhysical.Expr.Gte -> walkExprGte(node)
                is PartiqlPhysical.Expr.Lt -> walkExprLt(node)
                is PartiqlPhysical.Expr.Lte -> walkExprLte(node)
                is PartiqlPhysical.Expr.Like -> walkExprLike(node)
                is PartiqlPhysical.Expr.Between -> walkExprBetween(node)
                is PartiqlPhysical.Expr.InCollection -> walkExprInCollection(node)
                is PartiqlPhysical.Expr.IsType -> walkExprIsType(node)
                is PartiqlPhysical.Expr.SimpleCase -> walkExprSimpleCase(node)
                is PartiqlPhysical.Expr.SearchedCase -> walkExprSearchedCase(node)
                is PartiqlPhysical.Expr.Bag -> walkExprBag(node)
                is PartiqlPhysical.Expr.List -> walkExprList(node)
                is PartiqlPhysical.Expr.Sexp -> walkExprSexp(node)
                is PartiqlPhysical.Expr.Date -> walkExprDate(node)
                is PartiqlPhysical.Expr.LitTime -> walkExprLitTime(node)
                is PartiqlPhysical.Expr.BagOp -> walkExprBagOp(node)
                is PartiqlPhysical.Expr.GraphMatch -> walkExprGraphMatch(node)
                is PartiqlPhysical.Expr.Path -> walkExprPath(node)
                is PartiqlPhysical.Expr.Call -> walkExprCall(node)
                is PartiqlPhysical.Expr.Cast -> walkExprCast(node)
                is PartiqlPhysical.Expr.CanCast -> walkExprCanCast(node)
                is PartiqlPhysical.Expr.CanLosslessCast -> walkExprCanLosslessCast(node)
                is PartiqlPhysical.Expr.NullIf -> walkExprNullIf(node)
                is PartiqlPhysical.Expr.Coalesce -> walkExprCoalesce(node)
                is PartiqlPhysical.Expr.BindingsToValues -> walkExprBindingsToValues(node)
                is PartiqlPhysical.Expr.Struct -> walkExprStruct(node)
                is PartiqlPhysical.Expr.Pivot -> walkExprPivot(node)
                is PartiqlPhysical.Expr.LocalId -> walkExprLocalId(node)
                is PartiqlPhysical.Expr.GlobalId -> walkExprGlobalId(node)
            }
        }
    
        open fun walkExprMissing(node: PartiqlPhysical.Expr.Missing) {
            visitExprMissing(node)
            walkMetas(node.metas)
        }
        open fun walkExprLit(node: PartiqlPhysical.Expr.Lit) {
            visitExprLit(node)
            walkAnyElement(node.value)
            walkMetas(node.metas)
        }
        open fun walkExprParameter(node: PartiqlPhysical.Expr.Parameter) {
            visitExprParameter(node)
            walkLongPrimitive(node.index)
            walkMetas(node.metas)
        }
        open fun walkExprNot(node: PartiqlPhysical.Expr.Not) {
            visitExprNot(node)
            walkExpr(node.expr)
            walkMetas(node.metas)
        }
        open fun walkExprPos(node: PartiqlPhysical.Expr.Pos) {
            visitExprPos(node)
            walkExpr(node.expr)
            walkMetas(node.metas)
        }
        open fun walkExprNeg(node: PartiqlPhysical.Expr.Neg) {
            visitExprNeg(node)
            walkExpr(node.expr)
            walkMetas(node.metas)
        }
        open fun walkExprPlus(node: PartiqlPhysical.Expr.Plus) {
            visitExprPlus(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprMinus(node: PartiqlPhysical.Expr.Minus) {
            visitExprMinus(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprTimes(node: PartiqlPhysical.Expr.Times) {
            visitExprTimes(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprDivide(node: PartiqlPhysical.Expr.Divide) {
            visitExprDivide(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprModulo(node: PartiqlPhysical.Expr.Modulo) {
            visitExprModulo(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprConcat(node: PartiqlPhysical.Expr.Concat) {
            visitExprConcat(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprAnd(node: PartiqlPhysical.Expr.And) {
            visitExprAnd(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprOr(node: PartiqlPhysical.Expr.Or) {
            visitExprOr(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprEq(node: PartiqlPhysical.Expr.Eq) {
            visitExprEq(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprNe(node: PartiqlPhysical.Expr.Ne) {
            visitExprNe(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprGt(node: PartiqlPhysical.Expr.Gt) {
            visitExprGt(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprGte(node: PartiqlPhysical.Expr.Gte) {
            visitExprGte(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprLt(node: PartiqlPhysical.Expr.Lt) {
            visitExprLt(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprLte(node: PartiqlPhysical.Expr.Lte) {
            visitExprLte(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprLike(node: PartiqlPhysical.Expr.Like) {
            visitExprLike(node)
            walkExpr(node.value)
            walkExpr(node.pattern)
            node.escape?.let { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprBetween(node: PartiqlPhysical.Expr.Between) {
            visitExprBetween(node)
            walkExpr(node.value)
            walkExpr(node.from)
            walkExpr(node.to)
            walkMetas(node.metas)
        }
        open fun walkExprInCollection(node: PartiqlPhysical.Expr.InCollection) {
            visitExprInCollection(node)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprIsType(node: PartiqlPhysical.Expr.IsType) {
            visitExprIsType(node)
            walkExpr(node.value)
            walkType(node.type)
            walkMetas(node.metas)
        }
        open fun walkExprSimpleCase(node: PartiqlPhysical.Expr.SimpleCase) {
            visitExprSimpleCase(node)
            walkExpr(node.expr)
            walkExprPairList(node.cases)
            node.default?.let { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprSearchedCase(node: PartiqlPhysical.Expr.SearchedCase) {
            visitExprSearchedCase(node)
            walkExprPairList(node.cases)
            node.default?.let { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprBag(node: PartiqlPhysical.Expr.Bag) {
            visitExprBag(node)
            node.values.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprList(node: PartiqlPhysical.Expr.List) {
            visitExprList(node)
            node.values.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprSexp(node: PartiqlPhysical.Expr.Sexp) {
            visitExprSexp(node)
            node.values.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprDate(node: PartiqlPhysical.Expr.Date) {
            visitExprDate(node)
            walkLongPrimitive(node.year)
            walkLongPrimitive(node.month)
            walkLongPrimitive(node.day)
            walkMetas(node.metas)
        }
        open fun walkExprLitTime(node: PartiqlPhysical.Expr.LitTime) {
            visitExprLitTime(node)
            walkTimeValue(node.value)
            walkMetas(node.metas)
        }
        open fun walkExprBagOp(node: PartiqlPhysical.Expr.BagOp) {
            visitExprBagOp(node)
            walkBagOpType(node.op)
            walkSetQuantifier(node.quantifier)
            node.operands.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprGraphMatch(node: PartiqlPhysical.Expr.GraphMatch) {
            visitExprGraphMatch(node)
            walkExpr(node.expr)
            walkGpmlPattern(node.gpmlPattern)
            walkMetas(node.metas)
        }
        open fun walkExprPath(node: PartiqlPhysical.Expr.Path) {
            visitExprPath(node)
            walkExpr(node.root)
            node.steps.map { walkPathStep(it) }
            walkMetas(node.metas)
        }
        open fun walkExprCall(node: PartiqlPhysical.Expr.Call) {
            visitExprCall(node)
            walkSymbolPrimitive(node.funcName)
            node.args.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprCast(node: PartiqlPhysical.Expr.Cast) {
            visitExprCast(node)
            walkExpr(node.value)
            walkType(node.asType)
            walkMetas(node.metas)
        }
        open fun walkExprCanCast(node: PartiqlPhysical.Expr.CanCast) {
            visitExprCanCast(node)
            walkExpr(node.value)
            walkType(node.asType)
            walkMetas(node.metas)
        }
        open fun walkExprCanLosslessCast(node: PartiqlPhysical.Expr.CanLosslessCast) {
            visitExprCanLosslessCast(node)
            walkExpr(node.value)
            walkType(node.asType)
            walkMetas(node.metas)
        }
        open fun walkExprNullIf(node: PartiqlPhysical.Expr.NullIf) {
            visitExprNullIf(node)
            walkExpr(node.expr1)
            walkExpr(node.expr2)
            walkMetas(node.metas)
        }
        open fun walkExprCoalesce(node: PartiqlPhysical.Expr.Coalesce) {
            visitExprCoalesce(node)
            node.args.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkExprBindingsToValues(node: PartiqlPhysical.Expr.BindingsToValues) {
            visitExprBindingsToValues(node)
            walkExpr(node.exp)
            walkBexpr(node.query)
            walkMetas(node.metas)
        }
        open fun walkExprStruct(node: PartiqlPhysical.Expr.Struct) {
            visitExprStruct(node)
            node.parts.map { walkStructPart(it) }
            walkMetas(node.metas)
        }
        open fun walkExprPivot(node: PartiqlPhysical.Expr.Pivot) {
            visitExprPivot(node)
            walkBexpr(node.input)
            walkExpr(node.key)
            walkExpr(node.value)
            walkMetas(node.metas)
        }
        open fun walkExprLocalId(node: PartiqlPhysical.Expr.LocalId) {
            visitExprLocalId(node)
            walkLongPrimitive(node.index)
            walkMetas(node.metas)
        }
        open fun walkExprGlobalId(node: PartiqlPhysical.Expr.GlobalId) {
            visitExprGlobalId(node)
            walkSymbolPrimitive(node.uniqueId)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: Statement
        //////////////////////////////////////
        open fun walkStatement(node: PartiqlPhysical.Statement) {
            visitStatement(node)
            when(node) {
                is PartiqlPhysical.Statement.Query -> walkStatementQuery(node)
                is PartiqlPhysical.Statement.Exec -> walkStatementExec(node)
                is PartiqlPhysical.Statement.Explain -> walkStatementExplain(node)
                is PartiqlPhysical.Statement.DmlQuery -> walkStatementDmlQuery(node)
            }
        }
    
        open fun walkStatementQuery(node: PartiqlPhysical.Statement.Query) {
            visitStatementQuery(node)
            walkExpr(node.expr)
            walkMetas(node.metas)
        }
        open fun walkStatementExec(node: PartiqlPhysical.Statement.Exec) {
            visitStatementExec(node)
            walkSymbolPrimitive(node.procedureName)
            node.args.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkStatementExplain(node: PartiqlPhysical.Statement.Explain) {
            visitStatementExplain(node)
            walkExplainTarget(node.target)
            walkMetas(node.metas)
        }
        open fun walkStatementDmlQuery(node: PartiqlPhysical.Statement.DmlQuery) {
            visitStatementDmlQuery(node)
            walkExpr(node.expr)
            walkMetas(node.metas)
        }
        //////////////////////////////////////
        // Sum Type: Bexpr
        //////////////////////////////////////
        open fun walkBexpr(node: PartiqlPhysical.Bexpr) {
            visitBexpr(node)
            when(node) {
                is PartiqlPhysical.Bexpr.Project -> walkBexprProject(node)
                is PartiqlPhysical.Bexpr.Scan -> walkBexprScan(node)
                is PartiqlPhysical.Bexpr.Unpivot -> walkBexprUnpivot(node)
                is PartiqlPhysical.Bexpr.Filter -> walkBexprFilter(node)
                is PartiqlPhysical.Bexpr.Join -> walkBexprJoin(node)
                is PartiqlPhysical.Bexpr.Sort -> walkBexprSort(node)
                is PartiqlPhysical.Bexpr.Aggregate -> walkBexprAggregate(node)
                is PartiqlPhysical.Bexpr.Offset -> walkBexprOffset(node)
                is PartiqlPhysical.Bexpr.Limit -> walkBexprLimit(node)
                is PartiqlPhysical.Bexpr.Let -> walkBexprLet(node)
                is PartiqlPhysical.Bexpr.Window -> walkBexprWindow(node)
            }
        }
    
        open fun walkBexprProject(node: PartiqlPhysical.Bexpr.Project) {
            visitBexprProject(node)
            walkImpl(node.i)
            walkVarDecl(node.binding)
            node.args.map { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkBexprScan(node: PartiqlPhysical.Bexpr.Scan) {
            visitBexprScan(node)
            walkImpl(node.i)
            walkExpr(node.expr)
            walkVarDecl(node.asDecl)
            node.atDecl?.let { walkVarDecl(it) }
            node.byDecl?.let { walkVarDecl(it) }
            walkMetas(node.metas)
        }
        open fun walkBexprUnpivot(node: PartiqlPhysical.Bexpr.Unpivot) {
            visitBexprUnpivot(node)
            walkImpl(node.i)
            walkExpr(node.expr)
            walkVarDecl(node.asDecl)
            node.atDecl?.let { walkVarDecl(it) }
            node.byDecl?.let { walkVarDecl(it) }
            walkMetas(node.metas)
        }
        open fun walkBexprFilter(node: PartiqlPhysical.Bexpr.Filter) {
            visitBexprFilter(node)
            walkImpl(node.i)
            walkExpr(node.predicate)
            walkBexpr(node.source)
            walkMetas(node.metas)
        }
        open fun walkBexprJoin(node: PartiqlPhysical.Bexpr.Join) {
            visitBexprJoin(node)
            walkImpl(node.i)
            walkJoinType(node.joinType)
            walkBexpr(node.left)
            walkBexpr(node.right)
            node.predicate?.let { walkExpr(it) }
            walkMetas(node.metas)
        }
        open fun walkBexprSort(node: PartiqlPhysical.Bexpr.Sort) {
            visitBexprSort(node)
            walkImpl(node.i)
            walkBexpr(node.source)
            node.sortSpecs.map { walkSortSpec(it) }
            walkMetas(node.metas)
        }
        open fun walkBexprAggregate(node: PartiqlPhysical.Bexpr.Aggregate) {
            visitBexprAggregate(node)
            walkImpl(node.i)
            walkBexpr(node.source)
            walkGroupingStrategy(node.strategy)
            walkGroupKeyList(node.groupList)
            walkAggregateFunctionList(node.functionList)
            walkMetas(node.metas)
        }
        open fun walkBexprOffset(node: PartiqlPhysical.Bexpr.Offset) {
            visitBexprOffset(node)
            walkImpl(node.i)
            walkExpr(node.rowCount)
            walkBexpr(node.source)
            walkMetas(node.metas)
        }
        open fun walkBexprLimit(node: PartiqlPhysical.Bexpr.Limit) {
            visitBexprLimit(node)
            walkImpl(node.i)
            walkExpr(node.rowCount)
            walkBexpr(node.source)
            walkMetas(node.metas)
        }
        open fun walkBexprLet(node: PartiqlPhysical.Bexpr.Let) {
            visitBexprLet(node)
            walkImpl(node.i)
            walkBexpr(node.source)
            node.bindings.map { walkLetBinding(it) }
            walkMetas(node.metas)
        }
        open fun walkBexprWindow(node: PartiqlPhysical.Bexpr.Window) {
            visitBexprWindow(node)
            walkImpl(node.i)
            walkBexpr(node.source)
            walkOver(node.windowSpecification)
            node.windowExpressionList.map { walkWindowExpression(it) }
            walkMetas(node.metas)
        }
    }
    open class VisitorFold : DomainVisitorFoldBase() {
        ////////////////////////////////////////////////////////////////////////////
        // Visit Functions
        ////////////////////////////////////////////////////////////////////////////
    
        //////////////////////////////////////
        // Tuple Types
        //////////////////////////////////////
        open protected fun visitTimeValue(node: PartiqlPhysical.TimeValue, accumulator: T): T = accumulator
        open protected fun visitGraphMatchQuantifier(node: PartiqlPhysical.GraphMatchQuantifier, accumulator: T): T = accumulator
        open protected fun visitGraphMatchPattern(node: PartiqlPhysical.GraphMatchPattern, accumulator: T): T = accumulator
        open protected fun visitGpmlPattern(node: PartiqlPhysical.GpmlPattern, accumulator: T): T = accumulator
        open protected fun visitExprPair(node: PartiqlPhysical.ExprPair, accumulator: T): T = accumulator
        open protected fun visitExprPairList(node: PartiqlPhysical.ExprPairList, accumulator: T): T = accumulator
        open protected fun visitSortSpec(node: PartiqlPhysical.SortSpec, accumulator: T): T = accumulator
        open protected fun visitOver(node: PartiqlPhysical.Over, accumulator: T): T = accumulator
        open protected fun visitWindowPartitionList(node: PartiqlPhysical.WindowPartitionList, accumulator: T): T = accumulator
        open protected fun visitWindowSortSpecList(node: PartiqlPhysical.WindowSortSpecList, accumulator: T): T = accumulator
        open protected fun visitIdentifier(node: PartiqlPhysical.Identifier, accumulator: T): T = accumulator
        open protected fun visitLetBinding(node: PartiqlPhysical.LetBinding, accumulator: T): T = accumulator
        open protected fun visitGroupKey(node: PartiqlPhysical.GroupKey, accumulator: T): T = accumulator
        open protected fun visitGroupKeyList(node: PartiqlPhysical.GroupKeyList, accumulator: T): T = accumulator
        open protected fun visitAggregateFunction(node: PartiqlPhysical.AggregateFunction, accumulator: T): T = accumulator
        open protected fun visitAggregateFunctionList(node: PartiqlPhysical.AggregateFunctionList, accumulator: T): T = accumulator
        open protected fun visitWindowExpression(node: PartiqlPhysical.WindowExpression, accumulator: T): T = accumulator
        open protected fun visitPlan(node: PartiqlPhysical.Plan, accumulator: T): T = accumulator
        open protected fun visitLocalVariable(node: PartiqlPhysical.LocalVariable, accumulator: T): T = accumulator
        open protected fun visitVarDecl(node: PartiqlPhysical.VarDecl, accumulator: T): T = accumulator
        open protected fun visitImpl(node: PartiqlPhysical.Impl, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: ExplainTarget
        //////////////////////////////////////
        open protected fun visitExplainTarget(node: PartiqlPhysical.ExplainTarget, accumulator: T): T = accumulator
        open protected fun visitExplainTargetDomain(node: PartiqlPhysical.ExplainTarget.Domain, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: PathStep
        //////////////////////////////////////
        open protected fun visitPathStep(node: PartiqlPhysical.PathStep, accumulator: T): T = accumulator
        open protected fun visitPathStepPathExpr(node: PartiqlPhysical.PathStep.PathExpr, accumulator: T): T = accumulator
        open protected fun visitPathStepPathWildcard(node: PartiqlPhysical.PathStep.PathWildcard, accumulator: T): T = accumulator
        open protected fun visitPathStepPathUnpivot(node: PartiqlPhysical.PathStep.PathUnpivot, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: JoinType
        //////////////////////////////////////
        open protected fun visitJoinType(node: PartiqlPhysical.JoinType, accumulator: T): T = accumulator
        open protected fun visitJoinTypeInner(node: PartiqlPhysical.JoinType.Inner, accumulator: T): T = accumulator
        open protected fun visitJoinTypeLeft(node: PartiqlPhysical.JoinType.Left, accumulator: T): T = accumulator
        open protected fun visitJoinTypeRight(node: PartiqlPhysical.JoinType.Right, accumulator: T): T = accumulator
        open protected fun visitJoinTypeFull(node: PartiqlPhysical.JoinType.Full, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: GraphMatchDirection
        //////////////////////////////////////
        open protected fun visitGraphMatchDirection(node: PartiqlPhysical.GraphMatchDirection, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeLeft(node: PartiqlPhysical.GraphMatchDirection.EdgeLeft, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeUndirected(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirected, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeRight(node: PartiqlPhysical.GraphMatchDirection.EdgeRight, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeLeftOrUndirected(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeUndirectedOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeLeftOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight, accumulator: T): T = accumulator
        open protected fun visitGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: GraphMatchPatternPart
        //////////////////////////////////////
        open protected fun visitGraphMatchPatternPart(node: PartiqlPhysical.GraphMatchPatternPart, accumulator: T): T = accumulator
        open protected fun visitGraphMatchPatternPartNode(node: PartiqlPhysical.GraphMatchPatternPart.Node, accumulator: T): T = accumulator
        open protected fun visitGraphMatchPatternPartEdge(node: PartiqlPhysical.GraphMatchPatternPart.Edge, accumulator: T): T = accumulator
        open protected fun visitGraphMatchPatternPartPattern(node: PartiqlPhysical.GraphMatchPatternPart.Pattern, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: GraphMatchRestrictor
        //////////////////////////////////////
        open protected fun visitGraphMatchRestrictor(node: PartiqlPhysical.GraphMatchRestrictor, accumulator: T): T = accumulator
        open protected fun visitGraphMatchRestrictorRestrictorTrail(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail, accumulator: T): T = accumulator
        open protected fun visitGraphMatchRestrictorRestrictorAcyclic(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic, accumulator: T): T = accumulator
        open protected fun visitGraphMatchRestrictorRestrictorSimple(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: GraphMatchSelector
        //////////////////////////////////////
        open protected fun visitGraphMatchSelector(node: PartiqlPhysical.GraphMatchSelector, accumulator: T): T = accumulator
        open protected fun visitGraphMatchSelectorSelectorAnyShortest(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest, accumulator: T): T = accumulator
        open protected fun visitGraphMatchSelectorSelectorAllShortest(node: PartiqlPhysical.GraphMatchSelector.SelectorAllShortest, accumulator: T): T = accumulator
        open protected fun visitGraphMatchSelectorSelectorAny(node: PartiqlPhysical.GraphMatchSelector.SelectorAny, accumulator: T): T = accumulator
        open protected fun visitGraphMatchSelectorSelectorAnyK(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyK, accumulator: T): T = accumulator
        open protected fun visitGraphMatchSelectorSelectorShortestK(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestK, accumulator: T): T = accumulator
        open protected fun visitGraphMatchSelectorSelectorShortestKGroup(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: GroupingStrategy
        //////////////////////////////////////
        open protected fun visitGroupingStrategy(node: PartiqlPhysical.GroupingStrategy, accumulator: T): T = accumulator
        open protected fun visitGroupingStrategyGroupFull(node: PartiqlPhysical.GroupingStrategy.GroupFull, accumulator: T): T = accumulator
        open protected fun visitGroupingStrategyGroupPartial(node: PartiqlPhysical.GroupingStrategy.GroupPartial, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: OrderingSpec
        //////////////////////////////////////
        open protected fun visitOrderingSpec(node: PartiqlPhysical.OrderingSpec, accumulator: T): T = accumulator
        open protected fun visitOrderingSpecAsc(node: PartiqlPhysical.OrderingSpec.Asc, accumulator: T): T = accumulator
        open protected fun visitOrderingSpecDesc(node: PartiqlPhysical.OrderingSpec.Desc, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: NullsSpec
        //////////////////////////////////////
        open protected fun visitNullsSpec(node: PartiqlPhysical.NullsSpec, accumulator: T): T = accumulator
        open protected fun visitNullsSpecNullsFirst(node: PartiqlPhysical.NullsSpec.NullsFirst, accumulator: T): T = accumulator
        open protected fun visitNullsSpecNullsLast(node: PartiqlPhysical.NullsSpec.NullsLast, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: CaseSensitivity
        //////////////////////////////////////
        open protected fun visitCaseSensitivity(node: PartiqlPhysical.CaseSensitivity, accumulator: T): T = accumulator
        open protected fun visitCaseSensitivityCaseSensitive(node: PartiqlPhysical.CaseSensitivity.CaseSensitive, accumulator: T): T = accumulator
        open protected fun visitCaseSensitivityCaseInsensitive(node: PartiqlPhysical.CaseSensitivity.CaseInsensitive, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: SetQuantifier
        //////////////////////////////////////
        open protected fun visitSetQuantifier(node: PartiqlPhysical.SetQuantifier, accumulator: T): T = accumulator
        open protected fun visitSetQuantifierAll(node: PartiqlPhysical.SetQuantifier.All, accumulator: T): T = accumulator
        open protected fun visitSetQuantifierDistinct(node: PartiqlPhysical.SetQuantifier.Distinct, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: BagOpType
        //////////////////////////////////////
        open protected fun visitBagOpType(node: PartiqlPhysical.BagOpType, accumulator: T): T = accumulator
        open protected fun visitBagOpTypeUnion(node: PartiqlPhysical.BagOpType.Union, accumulator: T): T = accumulator
        open protected fun visitBagOpTypeIntersect(node: PartiqlPhysical.BagOpType.Intersect, accumulator: T): T = accumulator
        open protected fun visitBagOpTypeExcept(node: PartiqlPhysical.BagOpType.Except, accumulator: T): T = accumulator
        open protected fun visitBagOpTypeOuterUnion(node: PartiqlPhysical.BagOpType.OuterUnion, accumulator: T): T = accumulator
        open protected fun visitBagOpTypeOuterIntersect(node: PartiqlPhysical.BagOpType.OuterIntersect, accumulator: T): T = accumulator
        open protected fun visitBagOpTypeOuterExcept(node: PartiqlPhysical.BagOpType.OuterExcept, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: OnConflictValue
        //////////////////////////////////////
        open protected fun visitOnConflictValue(node: PartiqlPhysical.OnConflictValue, accumulator: T): T = accumulator
        open protected fun visitOnConflictValueExcluded(node: PartiqlPhysical.OnConflictValue.Excluded, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: Type
        //////////////////////////////////////
        open protected fun visitType(node: PartiqlPhysical.Type, accumulator: T): T = accumulator
        open protected fun visitTypeNullType(node: PartiqlPhysical.Type.NullType, accumulator: T): T = accumulator
        open protected fun visitTypeBooleanType(node: PartiqlPhysical.Type.BooleanType, accumulator: T): T = accumulator
        open protected fun visitTypeSmallintType(node: PartiqlPhysical.Type.SmallintType, accumulator: T): T = accumulator
        open protected fun visitTypeInteger4Type(node: PartiqlPhysical.Type.Integer4Type, accumulator: T): T = accumulator
        open protected fun visitTypeInteger8Type(node: PartiqlPhysical.Type.Integer8Type, accumulator: T): T = accumulator
        open protected fun visitTypeIntegerType(node: PartiqlPhysical.Type.IntegerType, accumulator: T): T = accumulator
        open protected fun visitTypeFloatType(node: PartiqlPhysical.Type.FloatType, accumulator: T): T = accumulator
        open protected fun visitTypeRealType(node: PartiqlPhysical.Type.RealType, accumulator: T): T = accumulator
        open protected fun visitTypeDoublePrecisionType(node: PartiqlPhysical.Type.DoublePrecisionType, accumulator: T): T = accumulator
        open protected fun visitTypeDecimalType(node: PartiqlPhysical.Type.DecimalType, accumulator: T): T = accumulator
        open protected fun visitTypeNumericType(node: PartiqlPhysical.Type.NumericType, accumulator: T): T = accumulator
        open protected fun visitTypeTimestampType(node: PartiqlPhysical.Type.TimestampType, accumulator: T): T = accumulator
        open protected fun visitTypeCharacterType(node: PartiqlPhysical.Type.CharacterType, accumulator: T): T = accumulator
        open protected fun visitTypeCharacterVaryingType(node: PartiqlPhysical.Type.CharacterVaryingType, accumulator: T): T = accumulator
        open protected fun visitTypeMissingType(node: PartiqlPhysical.Type.MissingType, accumulator: T): T = accumulator
        open protected fun visitTypeStringType(node: PartiqlPhysical.Type.StringType, accumulator: T): T = accumulator
        open protected fun visitTypeSymbolType(node: PartiqlPhysical.Type.SymbolType, accumulator: T): T = accumulator
        open protected fun visitTypeBlobType(node: PartiqlPhysical.Type.BlobType, accumulator: T): T = accumulator
        open protected fun visitTypeClobType(node: PartiqlPhysical.Type.ClobType, accumulator: T): T = accumulator
        open protected fun visitTypeDateType(node: PartiqlPhysical.Type.DateType, accumulator: T): T = accumulator
        open protected fun visitTypeTimeType(node: PartiqlPhysical.Type.TimeType, accumulator: T): T = accumulator
        open protected fun visitTypeTimeWithTimeZoneType(node: PartiqlPhysical.Type.TimeWithTimeZoneType, accumulator: T): T = accumulator
        open protected fun visitTypeStructType(node: PartiqlPhysical.Type.StructType, accumulator: T): T = accumulator
        open protected fun visitTypeTupleType(node: PartiqlPhysical.Type.TupleType, accumulator: T): T = accumulator
        open protected fun visitTypeListType(node: PartiqlPhysical.Type.ListType, accumulator: T): T = accumulator
        open protected fun visitTypeSexpType(node: PartiqlPhysical.Type.SexpType, accumulator: T): T = accumulator
        open protected fun visitTypeBagType(node: PartiqlPhysical.Type.BagType, accumulator: T): T = accumulator
        open protected fun visitTypeAnyType(node: PartiqlPhysical.Type.AnyType, accumulator: T): T = accumulator
        open protected fun visitTypeCustomType(node: PartiqlPhysical.Type.CustomType, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: StructPart
        //////////////////////////////////////
        open protected fun visitStructPart(node: PartiqlPhysical.StructPart, accumulator: T): T = accumulator
        open protected fun visitStructPartStructFields(node: PartiqlPhysical.StructPart.StructFields, accumulator: T): T = accumulator
        open protected fun visitStructPartStructField(node: PartiqlPhysical.StructPart.StructField, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: Expr
        //////////////////////////////////////
        open protected fun visitExpr(node: PartiqlPhysical.Expr, accumulator: T): T = accumulator
        open protected fun visitExprMissing(node: PartiqlPhysical.Expr.Missing, accumulator: T): T = accumulator
        open protected fun visitExprLit(node: PartiqlPhysical.Expr.Lit, accumulator: T): T = accumulator
        open protected fun visitExprParameter(node: PartiqlPhysical.Expr.Parameter, accumulator: T): T = accumulator
        open protected fun visitExprNot(node: PartiqlPhysical.Expr.Not, accumulator: T): T = accumulator
        open protected fun visitExprPos(node: PartiqlPhysical.Expr.Pos, accumulator: T): T = accumulator
        open protected fun visitExprNeg(node: PartiqlPhysical.Expr.Neg, accumulator: T): T = accumulator
        open protected fun visitExprPlus(node: PartiqlPhysical.Expr.Plus, accumulator: T): T = accumulator
        open protected fun visitExprMinus(node: PartiqlPhysical.Expr.Minus, accumulator: T): T = accumulator
        open protected fun visitExprTimes(node: PartiqlPhysical.Expr.Times, accumulator: T): T = accumulator
        open protected fun visitExprDivide(node: PartiqlPhysical.Expr.Divide, accumulator: T): T = accumulator
        open protected fun visitExprModulo(node: PartiqlPhysical.Expr.Modulo, accumulator: T): T = accumulator
        open protected fun visitExprConcat(node: PartiqlPhysical.Expr.Concat, accumulator: T): T = accumulator
        open protected fun visitExprAnd(node: PartiqlPhysical.Expr.And, accumulator: T): T = accumulator
        open protected fun visitExprOr(node: PartiqlPhysical.Expr.Or, accumulator: T): T = accumulator
        open protected fun visitExprEq(node: PartiqlPhysical.Expr.Eq, accumulator: T): T = accumulator
        open protected fun visitExprNe(node: PartiqlPhysical.Expr.Ne, accumulator: T): T = accumulator
        open protected fun visitExprGt(node: PartiqlPhysical.Expr.Gt, accumulator: T): T = accumulator
        open protected fun visitExprGte(node: PartiqlPhysical.Expr.Gte, accumulator: T): T = accumulator
        open protected fun visitExprLt(node: PartiqlPhysical.Expr.Lt, accumulator: T): T = accumulator
        open protected fun visitExprLte(node: PartiqlPhysical.Expr.Lte, accumulator: T): T = accumulator
        open protected fun visitExprLike(node: PartiqlPhysical.Expr.Like, accumulator: T): T = accumulator
        open protected fun visitExprBetween(node: PartiqlPhysical.Expr.Between, accumulator: T): T = accumulator
        open protected fun visitExprInCollection(node: PartiqlPhysical.Expr.InCollection, accumulator: T): T = accumulator
        open protected fun visitExprIsType(node: PartiqlPhysical.Expr.IsType, accumulator: T): T = accumulator
        open protected fun visitExprSimpleCase(node: PartiqlPhysical.Expr.SimpleCase, accumulator: T): T = accumulator
        open protected fun visitExprSearchedCase(node: PartiqlPhysical.Expr.SearchedCase, accumulator: T): T = accumulator
        open protected fun visitExprBag(node: PartiqlPhysical.Expr.Bag, accumulator: T): T = accumulator
        open protected fun visitExprList(node: PartiqlPhysical.Expr.List, accumulator: T): T = accumulator
        open protected fun visitExprSexp(node: PartiqlPhysical.Expr.Sexp, accumulator: T): T = accumulator
        open protected fun visitExprDate(node: PartiqlPhysical.Expr.Date, accumulator: T): T = accumulator
        open protected fun visitExprLitTime(node: PartiqlPhysical.Expr.LitTime, accumulator: T): T = accumulator
        open protected fun visitExprBagOp(node: PartiqlPhysical.Expr.BagOp, accumulator: T): T = accumulator
        open protected fun visitExprGraphMatch(node: PartiqlPhysical.Expr.GraphMatch, accumulator: T): T = accumulator
        open protected fun visitExprPath(node: PartiqlPhysical.Expr.Path, accumulator: T): T = accumulator
        open protected fun visitExprCall(node: PartiqlPhysical.Expr.Call, accumulator: T): T = accumulator
        open protected fun visitExprCast(node: PartiqlPhysical.Expr.Cast, accumulator: T): T = accumulator
        open protected fun visitExprCanCast(node: PartiqlPhysical.Expr.CanCast, accumulator: T): T = accumulator
        open protected fun visitExprCanLosslessCast(node: PartiqlPhysical.Expr.CanLosslessCast, accumulator: T): T = accumulator
        open protected fun visitExprNullIf(node: PartiqlPhysical.Expr.NullIf, accumulator: T): T = accumulator
        open protected fun visitExprCoalesce(node: PartiqlPhysical.Expr.Coalesce, accumulator: T): T = accumulator
        open protected fun visitExprBindingsToValues(node: PartiqlPhysical.Expr.BindingsToValues, accumulator: T): T = accumulator
        open protected fun visitExprStruct(node: PartiqlPhysical.Expr.Struct, accumulator: T): T = accumulator
        open protected fun visitExprPivot(node: PartiqlPhysical.Expr.Pivot, accumulator: T): T = accumulator
        open protected fun visitExprLocalId(node: PartiqlPhysical.Expr.LocalId, accumulator: T): T = accumulator
        open protected fun visitExprGlobalId(node: PartiqlPhysical.Expr.GlobalId, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: Statement
        //////////////////////////////////////
        open protected fun visitStatement(node: PartiqlPhysical.Statement, accumulator: T): T = accumulator
        open protected fun visitStatementQuery(node: PartiqlPhysical.Statement.Query, accumulator: T): T = accumulator
        open protected fun visitStatementExec(node: PartiqlPhysical.Statement.Exec, accumulator: T): T = accumulator
        open protected fun visitStatementExplain(node: PartiqlPhysical.Statement.Explain, accumulator: T): T = accumulator
        open protected fun visitStatementDmlQuery(node: PartiqlPhysical.Statement.DmlQuery, accumulator: T): T = accumulator
        //////////////////////////////////////
        // Sum Type: Bexpr
        //////////////////////////////////////
        open protected fun visitBexpr(node: PartiqlPhysical.Bexpr, accumulator: T): T = accumulator
        open protected fun visitBexprProject(node: PartiqlPhysical.Bexpr.Project, accumulator: T): T = accumulator
        open protected fun visitBexprScan(node: PartiqlPhysical.Bexpr.Scan, accumulator: T): T = accumulator
        open protected fun visitBexprUnpivot(node: PartiqlPhysical.Bexpr.Unpivot, accumulator: T): T = accumulator
        open protected fun visitBexprFilter(node: PartiqlPhysical.Bexpr.Filter, accumulator: T): T = accumulator
        open protected fun visitBexprJoin(node: PartiqlPhysical.Bexpr.Join, accumulator: T): T = accumulator
        open protected fun visitBexprSort(node: PartiqlPhysical.Bexpr.Sort, accumulator: T): T = accumulator
        open protected fun visitBexprAggregate(node: PartiqlPhysical.Bexpr.Aggregate, accumulator: T): T = accumulator
        open protected fun visitBexprOffset(node: PartiqlPhysical.Bexpr.Offset, accumulator: T): T = accumulator
        open protected fun visitBexprLimit(node: PartiqlPhysical.Bexpr.Limit, accumulator: T): T = accumulator
        open protected fun visitBexprLet(node: PartiqlPhysical.Bexpr.Let, accumulator: T): T = accumulator
        open protected fun visitBexprWindow(node: PartiqlPhysical.Bexpr.Window, accumulator: T): T = accumulator
    
        ////////////////////////////////////////////////////////////////////////////
        // Walk Functions
        ////////////////////////////////////////////////////////////////////////////
    
        //////////////////////////////////////
        // Tuple Types
        //////////////////////////////////////
        open fun walkTimeValue(node: PartiqlPhysical.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 walkGraphMatchQuantifier(node: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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 walkSortSpec(node: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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 walkIdentifier(node: PartiqlPhysical.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 walkLetBinding(node: PartiqlPhysical.LetBinding, accumulator: T): T {
            var current = accumulator
            current = visitLetBinding(node, current)
            current = walkExpr(node.value, current)
            current = walkVarDecl(node.decl, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGroupKey(node: PartiqlPhysical.GroupKey, accumulator: T): T {
            var current = accumulator
            current = visitGroupKey(node, current)
            current = walkExpr(node.expr, current)
            current = walkVarDecl(node.asVar, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGroupKeyList(node: PartiqlPhysical.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 walkAggregateFunction(node: PartiqlPhysical.AggregateFunction, accumulator: T): T {
            var current = accumulator
            current = visitAggregateFunction(node, current)
            current = walkSetQuantifier(node.quantifier, current)
            current = walkSymbolPrimitive(node.name, current)
            current = walkExpr(node.arg, current)
            current = walkVarDecl(node.asVar, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkAggregateFunctionList(node: PartiqlPhysical.AggregateFunctionList, accumulator: T): T {
            var current = accumulator
            current = visitAggregateFunctionList(node, current)
            node.functions.map { current = walkAggregateFunction(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkWindowExpression(node: PartiqlPhysical.WindowExpression, accumulator: T): T {
            var current = accumulator
            current = visitWindowExpression(node, current)
            current = walkVarDecl(node.decl, current)
            current = walkSymbolPrimitive(node.funcName, current)
            node.args.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkPlan(node: PartiqlPhysical.Plan, accumulator: T): T {
            var current = accumulator
            current = visitPlan(node, current)
            current = walkStatement(node.stmt, current)
            current = walkSymbolPrimitive(node.version, current)
            node.locals.map { current = walkLocalVariable(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkLocalVariable(node: PartiqlPhysical.LocalVariable, accumulator: T): T {
            var current = accumulator
            current = visitLocalVariable(node, current)
            current = walkSymbolPrimitive(node.name, current)
            current = walkLongPrimitive(node.registerIndex, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkVarDecl(node: PartiqlPhysical.VarDecl, accumulator: T): T {
            var current = accumulator
            current = visitVarDecl(node, current)
            current = walkLongPrimitive(node.index, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkImpl(node: PartiqlPhysical.Impl, accumulator: T): T {
            var current = accumulator
            current = visitImpl(node, current)
            current = walkSymbolPrimitive(node.name, current)
            node.staticArgs.map { current = walkAnyElement(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: ExplainTarget
        //////////////////////////////////////
        open fun walkExplainTarget(node: PartiqlPhysical.ExplainTarget, accumulator: T): T {
            val current = visitExplainTarget(node, accumulator)
            return when(node) {
                is PartiqlPhysical.ExplainTarget.Domain -> walkExplainTargetDomain(node, current)
            }
        }
    
        open fun walkExplainTargetDomain(node: PartiqlPhysical.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: PathStep
        //////////////////////////////////////
        open fun walkPathStep(node: PartiqlPhysical.PathStep, accumulator: T): T {
            val current = visitPathStep(node, accumulator)
            return when(node) {
                is PartiqlPhysical.PathStep.PathExpr -> walkPathStepPathExpr(node, current)
                is PartiqlPhysical.PathStep.PathWildcard -> walkPathStepPathWildcard(node, current)
                is PartiqlPhysical.PathStep.PathUnpivot -> walkPathStepPathUnpivot(node, current)
            }
        }
    
        open fun walkPathStepPathExpr(node: PartiqlPhysical.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: PartiqlPhysical.PathStep.PathWildcard, accumulator: T): T {
            var current = accumulator
            current = visitPathStepPathWildcard(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkPathStepPathUnpivot(node: PartiqlPhysical.PathStep.PathUnpivot, accumulator: T): T {
            var current = accumulator
            current = visitPathStepPathUnpivot(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: JoinType
        //////////////////////////////////////
        open fun walkJoinType(node: PartiqlPhysical.JoinType, accumulator: T): T {
            val current = visitJoinType(node, accumulator)
            return when(node) {
                is PartiqlPhysical.JoinType.Inner -> walkJoinTypeInner(node, current)
                is PartiqlPhysical.JoinType.Left -> walkJoinTypeLeft(node, current)
                is PartiqlPhysical.JoinType.Right -> walkJoinTypeRight(node, current)
                is PartiqlPhysical.JoinType.Full -> walkJoinTypeFull(node, current)
            }
        }
    
        open fun walkJoinTypeInner(node: PartiqlPhysical.JoinType.Inner, accumulator: T): T {
            var current = accumulator
            current = visitJoinTypeInner(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkJoinTypeLeft(node: PartiqlPhysical.JoinType.Left, accumulator: T): T {
            var current = accumulator
            current = visitJoinTypeLeft(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkJoinTypeRight(node: PartiqlPhysical.JoinType.Right, accumulator: T): T {
            var current = accumulator
            current = visitJoinTypeRight(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkJoinTypeFull(node: PartiqlPhysical.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: PartiqlPhysical.GraphMatchDirection, accumulator: T): T {
            val current = visitGraphMatchDirection(node, accumulator)
            return when(node) {
                is PartiqlPhysical.GraphMatchDirection.EdgeLeft -> walkGraphMatchDirectionEdgeLeft(node, current)
                is PartiqlPhysical.GraphMatchDirection.EdgeUndirected -> walkGraphMatchDirectionEdgeUndirected(node, current)
                is PartiqlPhysical.GraphMatchDirection.EdgeRight -> walkGraphMatchDirectionEdgeRight(node, current)
                is PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected -> walkGraphMatchDirectionEdgeLeftOrUndirected(node, current)
                is PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight -> walkGraphMatchDirectionEdgeUndirectedOrRight(node, current)
                is PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight -> walkGraphMatchDirectionEdgeLeftOrRight(node, current)
                is PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight -> walkGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node, current)
            }
        }
    
        open fun walkGraphMatchDirectionEdgeLeft(node: PartiqlPhysical.GraphMatchDirection.EdgeLeft, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchDirectionEdgeLeft(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchDirectionEdgeUndirected(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirected, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchDirectionEdgeUndirected(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchDirectionEdgeRight(node: PartiqlPhysical.GraphMatchDirection.EdgeRight, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchDirectionEdgeRight(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchDirectionEdgeLeftOrUndirected(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchDirectionEdgeLeftOrUndirected(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchDirectionEdgeUndirectedOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchDirectionEdgeUndirectedOrRight(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchDirectionEdgeLeftOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchDirectionEdgeLeftOrRight(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node: PartiqlPhysical.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: PartiqlPhysical.GraphMatchPatternPart, accumulator: T): T {
            val current = visitGraphMatchPatternPart(node, accumulator)
            return when(node) {
                is PartiqlPhysical.GraphMatchPatternPart.Node -> walkGraphMatchPatternPartNode(node, current)
                is PartiqlPhysical.GraphMatchPatternPart.Edge -> walkGraphMatchPatternPartEdge(node, current)
                is PartiqlPhysical.GraphMatchPatternPart.Pattern -> walkGraphMatchPatternPartPattern(node, current)
            }
        }
    
        open fun walkGraphMatchPatternPartNode(node: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.GraphMatchRestrictor, accumulator: T): T {
            val current = visitGraphMatchRestrictor(node, accumulator)
            return when(node) {
                is PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail -> walkGraphMatchRestrictorRestrictorTrail(node, current)
                is PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic -> walkGraphMatchRestrictorRestrictorAcyclic(node, current)
                is PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple -> walkGraphMatchRestrictorRestrictorSimple(node, current)
            }
        }
    
        open fun walkGraphMatchRestrictorRestrictorTrail(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchRestrictorRestrictorTrail(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchRestrictorRestrictorAcyclic(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchRestrictorRestrictorAcyclic(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchRestrictorRestrictorSimple(node: PartiqlPhysical.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: PartiqlPhysical.GraphMatchSelector, accumulator: T): T {
            val current = visitGraphMatchSelector(node, accumulator)
            return when(node) {
                is PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest -> walkGraphMatchSelectorSelectorAnyShortest(node, current)
                is PartiqlPhysical.GraphMatchSelector.SelectorAllShortest -> walkGraphMatchSelectorSelectorAllShortest(node, current)
                is PartiqlPhysical.GraphMatchSelector.SelectorAny -> walkGraphMatchSelectorSelectorAny(node, current)
                is PartiqlPhysical.GraphMatchSelector.SelectorAnyK -> walkGraphMatchSelectorSelectorAnyK(node, current)
                is PartiqlPhysical.GraphMatchSelector.SelectorShortestK -> walkGraphMatchSelectorSelectorShortestK(node, current)
                is PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup -> walkGraphMatchSelectorSelectorShortestKGroup(node, current)
            }
        }
    
        open fun walkGraphMatchSelectorSelectorAnyShortest(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchSelectorSelectorAnyShortest(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchSelectorSelectorAllShortest(node: PartiqlPhysical.GraphMatchSelector.SelectorAllShortest, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchSelectorSelectorAllShortest(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchSelectorSelectorAny(node: PartiqlPhysical.GraphMatchSelector.SelectorAny, accumulator: T): T {
            var current = accumulator
            current = visitGraphMatchSelectorSelectorAny(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGraphMatchSelectorSelectorAnyK(node: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.GroupingStrategy, accumulator: T): T {
            val current = visitGroupingStrategy(node, accumulator)
            return when(node) {
                is PartiqlPhysical.GroupingStrategy.GroupFull -> walkGroupingStrategyGroupFull(node, current)
                is PartiqlPhysical.GroupingStrategy.GroupPartial -> walkGroupingStrategyGroupPartial(node, current)
            }
        }
    
        open fun walkGroupingStrategyGroupFull(node: PartiqlPhysical.GroupingStrategy.GroupFull, accumulator: T): T {
            var current = accumulator
            current = visitGroupingStrategyGroupFull(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkGroupingStrategyGroupPartial(node: PartiqlPhysical.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: PartiqlPhysical.OrderingSpec, accumulator: T): T {
            val current = visitOrderingSpec(node, accumulator)
            return when(node) {
                is PartiqlPhysical.OrderingSpec.Asc -> walkOrderingSpecAsc(node, current)
                is PartiqlPhysical.OrderingSpec.Desc -> walkOrderingSpecDesc(node, current)
            }
        }
    
        open fun walkOrderingSpecAsc(node: PartiqlPhysical.OrderingSpec.Asc, accumulator: T): T {
            var current = accumulator
            current = visitOrderingSpecAsc(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkOrderingSpecDesc(node: PartiqlPhysical.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: PartiqlPhysical.NullsSpec, accumulator: T): T {
            val current = visitNullsSpec(node, accumulator)
            return when(node) {
                is PartiqlPhysical.NullsSpec.NullsFirst -> walkNullsSpecNullsFirst(node, current)
                is PartiqlPhysical.NullsSpec.NullsLast -> walkNullsSpecNullsLast(node, current)
            }
        }
    
        open fun walkNullsSpecNullsFirst(node: PartiqlPhysical.NullsSpec.NullsFirst, accumulator: T): T {
            var current = accumulator
            current = visitNullsSpecNullsFirst(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkNullsSpecNullsLast(node: PartiqlPhysical.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: PartiqlPhysical.CaseSensitivity, accumulator: T): T {
            val current = visitCaseSensitivity(node, accumulator)
            return when(node) {
                is PartiqlPhysical.CaseSensitivity.CaseSensitive -> walkCaseSensitivityCaseSensitive(node, current)
                is PartiqlPhysical.CaseSensitivity.CaseInsensitive -> walkCaseSensitivityCaseInsensitive(node, current)
            }
        }
    
        open fun walkCaseSensitivityCaseSensitive(node: PartiqlPhysical.CaseSensitivity.CaseSensitive, accumulator: T): T {
            var current = accumulator
            current = visitCaseSensitivityCaseSensitive(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkCaseSensitivityCaseInsensitive(node: PartiqlPhysical.CaseSensitivity.CaseInsensitive, accumulator: T): T {
            var current = accumulator
            current = visitCaseSensitivityCaseInsensitive(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: SetQuantifier
        //////////////////////////////////////
        open fun walkSetQuantifier(node: PartiqlPhysical.SetQuantifier, accumulator: T): T {
            val current = visitSetQuantifier(node, accumulator)
            return when(node) {
                is PartiqlPhysical.SetQuantifier.All -> walkSetQuantifierAll(node, current)
                is PartiqlPhysical.SetQuantifier.Distinct -> walkSetQuantifierDistinct(node, current)
            }
        }
    
        open fun walkSetQuantifierAll(node: PartiqlPhysical.SetQuantifier.All, accumulator: T): T {
            var current = accumulator
            current = visitSetQuantifierAll(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkSetQuantifierDistinct(node: PartiqlPhysical.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: PartiqlPhysical.BagOpType, accumulator: T): T {
            val current = visitBagOpType(node, accumulator)
            return when(node) {
                is PartiqlPhysical.BagOpType.Union -> walkBagOpTypeUnion(node, current)
                is PartiqlPhysical.BagOpType.Intersect -> walkBagOpTypeIntersect(node, current)
                is PartiqlPhysical.BagOpType.Except -> walkBagOpTypeExcept(node, current)
                is PartiqlPhysical.BagOpType.OuterUnion -> walkBagOpTypeOuterUnion(node, current)
                is PartiqlPhysical.BagOpType.OuterIntersect -> walkBagOpTypeOuterIntersect(node, current)
                is PartiqlPhysical.BagOpType.OuterExcept -> walkBagOpTypeOuterExcept(node, current)
            }
        }
    
        open fun walkBagOpTypeUnion(node: PartiqlPhysical.BagOpType.Union, accumulator: T): T {
            var current = accumulator
            current = visitBagOpTypeUnion(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBagOpTypeIntersect(node: PartiqlPhysical.BagOpType.Intersect, accumulator: T): T {
            var current = accumulator
            current = visitBagOpTypeIntersect(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBagOpTypeExcept(node: PartiqlPhysical.BagOpType.Except, accumulator: T): T {
            var current = accumulator
            current = visitBagOpTypeExcept(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBagOpTypeOuterUnion(node: PartiqlPhysical.BagOpType.OuterUnion, accumulator: T): T {
            var current = accumulator
            current = visitBagOpTypeOuterUnion(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBagOpTypeOuterIntersect(node: PartiqlPhysical.BagOpType.OuterIntersect, accumulator: T): T {
            var current = accumulator
            current = visitBagOpTypeOuterIntersect(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBagOpTypeOuterExcept(node: PartiqlPhysical.BagOpType.OuterExcept, accumulator: T): T {
            var current = accumulator
            current = visitBagOpTypeOuterExcept(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: OnConflictValue
        //////////////////////////////////////
        open fun walkOnConflictValue(node: PartiqlPhysical.OnConflictValue, accumulator: T): T {
            val current = visitOnConflictValue(node, accumulator)
            return when(node) {
                is PartiqlPhysical.OnConflictValue.Excluded -> walkOnConflictValueExcluded(node, current)
            }
        }
    
        open fun walkOnConflictValueExcluded(node: PartiqlPhysical.OnConflictValue.Excluded, accumulator: T): T {
            var current = accumulator
            current = visitOnConflictValueExcluded(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: Type
        //////////////////////////////////////
        open fun walkType(node: PartiqlPhysical.Type, accumulator: T): T {
            val current = visitType(node, accumulator)
            return when(node) {
                is PartiqlPhysical.Type.NullType -> walkTypeNullType(node, current)
                is PartiqlPhysical.Type.BooleanType -> walkTypeBooleanType(node, current)
                is PartiqlPhysical.Type.SmallintType -> walkTypeSmallintType(node, current)
                is PartiqlPhysical.Type.Integer4Type -> walkTypeInteger4Type(node, current)
                is PartiqlPhysical.Type.Integer8Type -> walkTypeInteger8Type(node, current)
                is PartiqlPhysical.Type.IntegerType -> walkTypeIntegerType(node, current)
                is PartiqlPhysical.Type.FloatType -> walkTypeFloatType(node, current)
                is PartiqlPhysical.Type.RealType -> walkTypeRealType(node, current)
                is PartiqlPhysical.Type.DoublePrecisionType -> walkTypeDoublePrecisionType(node, current)
                is PartiqlPhysical.Type.DecimalType -> walkTypeDecimalType(node, current)
                is PartiqlPhysical.Type.NumericType -> walkTypeNumericType(node, current)
                is PartiqlPhysical.Type.TimestampType -> walkTypeTimestampType(node, current)
                is PartiqlPhysical.Type.CharacterType -> walkTypeCharacterType(node, current)
                is PartiqlPhysical.Type.CharacterVaryingType -> walkTypeCharacterVaryingType(node, current)
                is PartiqlPhysical.Type.MissingType -> walkTypeMissingType(node, current)
                is PartiqlPhysical.Type.StringType -> walkTypeStringType(node, current)
                is PartiqlPhysical.Type.SymbolType -> walkTypeSymbolType(node, current)
                is PartiqlPhysical.Type.BlobType -> walkTypeBlobType(node, current)
                is PartiqlPhysical.Type.ClobType -> walkTypeClobType(node, current)
                is PartiqlPhysical.Type.DateType -> walkTypeDateType(node, current)
                is PartiqlPhysical.Type.TimeType -> walkTypeTimeType(node, current)
                is PartiqlPhysical.Type.TimeWithTimeZoneType -> walkTypeTimeWithTimeZoneType(node, current)
                is PartiqlPhysical.Type.StructType -> walkTypeStructType(node, current)
                is PartiqlPhysical.Type.TupleType -> walkTypeTupleType(node, current)
                is PartiqlPhysical.Type.ListType -> walkTypeListType(node, current)
                is PartiqlPhysical.Type.SexpType -> walkTypeSexpType(node, current)
                is PartiqlPhysical.Type.BagType -> walkTypeBagType(node, current)
                is PartiqlPhysical.Type.AnyType -> walkTypeAnyType(node, current)
                is PartiqlPhysical.Type.CustomType -> walkTypeCustomType(node, current)
            }
        }
    
        open fun walkTypeNullType(node: PartiqlPhysical.Type.NullType, accumulator: T): T {
            var current = accumulator
            current = visitTypeNullType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeBooleanType(node: PartiqlPhysical.Type.BooleanType, accumulator: T): T {
            var current = accumulator
            current = visitTypeBooleanType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeSmallintType(node: PartiqlPhysical.Type.SmallintType, accumulator: T): T {
            var current = accumulator
            current = visitTypeSmallintType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeInteger4Type(node: PartiqlPhysical.Type.Integer4Type, accumulator: T): T {
            var current = accumulator
            current = visitTypeInteger4Type(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeInteger8Type(node: PartiqlPhysical.Type.Integer8Type, accumulator: T): T {
            var current = accumulator
            current = visitTypeInteger8Type(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeIntegerType(node: PartiqlPhysical.Type.IntegerType, accumulator: T): T {
            var current = accumulator
            current = visitTypeIntegerType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeFloatType(node: PartiqlPhysical.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: PartiqlPhysical.Type.RealType, accumulator: T): T {
            var current = accumulator
            current = visitTypeRealType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeDoublePrecisionType(node: PartiqlPhysical.Type.DoublePrecisionType, accumulator: T): T {
            var current = accumulator
            current = visitTypeDoublePrecisionType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeDecimalType(node: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.Type.TimestampType, accumulator: T): T {
            var current = accumulator
            current = visitTypeTimestampType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeCharacterType(node: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.Type.MissingType, accumulator: T): T {
            var current = accumulator
            current = visitTypeMissingType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeStringType(node: PartiqlPhysical.Type.StringType, accumulator: T): T {
            var current = accumulator
            current = visitTypeStringType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeSymbolType(node: PartiqlPhysical.Type.SymbolType, accumulator: T): T {
            var current = accumulator
            current = visitTypeSymbolType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeBlobType(node: PartiqlPhysical.Type.BlobType, accumulator: T): T {
            var current = accumulator
            current = visitTypeBlobType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeClobType(node: PartiqlPhysical.Type.ClobType, accumulator: T): T {
            var current = accumulator
            current = visitTypeClobType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeDateType(node: PartiqlPhysical.Type.DateType, accumulator: T): T {
            var current = accumulator
            current = visitTypeDateType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeTimeType(node: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.Type.StructType, accumulator: T): T {
            var current = accumulator
            current = visitTypeStructType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeTupleType(node: PartiqlPhysical.Type.TupleType, accumulator: T): T {
            var current = accumulator
            current = visitTypeTupleType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeListType(node: PartiqlPhysical.Type.ListType, accumulator: T): T {
            var current = accumulator
            current = visitTypeListType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeSexpType(node: PartiqlPhysical.Type.SexpType, accumulator: T): T {
            var current = accumulator
            current = visitTypeSexpType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeBagType(node: PartiqlPhysical.Type.BagType, accumulator: T): T {
            var current = accumulator
            current = visitTypeBagType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeAnyType(node: PartiqlPhysical.Type.AnyType, accumulator: T): T {
            var current = accumulator
            current = visitTypeAnyType(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkTypeCustomType(node: PartiqlPhysical.Type.CustomType, accumulator: T): T {
            var current = accumulator
            current = visitTypeCustomType(node, current)
            current = walkSymbolPrimitive(node.name, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: StructPart
        //////////////////////////////////////
        open fun walkStructPart(node: PartiqlPhysical.StructPart, accumulator: T): T {
            val current = visitStructPart(node, accumulator)
            return when(node) {
                is PartiqlPhysical.StructPart.StructFields -> walkStructPartStructFields(node, current)
                is PartiqlPhysical.StructPart.StructField -> walkStructPartStructField(node, current)
            }
        }
    
        open fun walkStructPartStructFields(node: PartiqlPhysical.StructPart.StructFields, accumulator: T): T {
            var current = accumulator
            current = visitStructPartStructFields(node, current)
            current = walkExpr(node.partExpr, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkStructPartStructField(node: PartiqlPhysical.StructPart.StructField, accumulator: T): T {
            var current = accumulator
            current = visitStructPartStructField(node, current)
            current = walkExpr(node.fieldName, current)
            current = walkExpr(node.value, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: Expr
        //////////////////////////////////////
        open fun walkExpr(node: PartiqlPhysical.Expr, accumulator: T): T {
            val current = visitExpr(node, accumulator)
            return when(node) {
                is PartiqlPhysical.Expr.Missing -> walkExprMissing(node, current)
                is PartiqlPhysical.Expr.Lit -> walkExprLit(node, current)
                is PartiqlPhysical.Expr.Parameter -> walkExprParameter(node, current)
                is PartiqlPhysical.Expr.Not -> walkExprNot(node, current)
                is PartiqlPhysical.Expr.Pos -> walkExprPos(node, current)
                is PartiqlPhysical.Expr.Neg -> walkExprNeg(node, current)
                is PartiqlPhysical.Expr.Plus -> walkExprPlus(node, current)
                is PartiqlPhysical.Expr.Minus -> walkExprMinus(node, current)
                is PartiqlPhysical.Expr.Times -> walkExprTimes(node, current)
                is PartiqlPhysical.Expr.Divide -> walkExprDivide(node, current)
                is PartiqlPhysical.Expr.Modulo -> walkExprModulo(node, current)
                is PartiqlPhysical.Expr.Concat -> walkExprConcat(node, current)
                is PartiqlPhysical.Expr.And -> walkExprAnd(node, current)
                is PartiqlPhysical.Expr.Or -> walkExprOr(node, current)
                is PartiqlPhysical.Expr.Eq -> walkExprEq(node, current)
                is PartiqlPhysical.Expr.Ne -> walkExprNe(node, current)
                is PartiqlPhysical.Expr.Gt -> walkExprGt(node, current)
                is PartiqlPhysical.Expr.Gte -> walkExprGte(node, current)
                is PartiqlPhysical.Expr.Lt -> walkExprLt(node, current)
                is PartiqlPhysical.Expr.Lte -> walkExprLte(node, current)
                is PartiqlPhysical.Expr.Like -> walkExprLike(node, current)
                is PartiqlPhysical.Expr.Between -> walkExprBetween(node, current)
                is PartiqlPhysical.Expr.InCollection -> walkExprInCollection(node, current)
                is PartiqlPhysical.Expr.IsType -> walkExprIsType(node, current)
                is PartiqlPhysical.Expr.SimpleCase -> walkExprSimpleCase(node, current)
                is PartiqlPhysical.Expr.SearchedCase -> walkExprSearchedCase(node, current)
                is PartiqlPhysical.Expr.Bag -> walkExprBag(node, current)
                is PartiqlPhysical.Expr.List -> walkExprList(node, current)
                is PartiqlPhysical.Expr.Sexp -> walkExprSexp(node, current)
                is PartiqlPhysical.Expr.Date -> walkExprDate(node, current)
                is PartiqlPhysical.Expr.LitTime -> walkExprLitTime(node, current)
                is PartiqlPhysical.Expr.BagOp -> walkExprBagOp(node, current)
                is PartiqlPhysical.Expr.GraphMatch -> walkExprGraphMatch(node, current)
                is PartiqlPhysical.Expr.Path -> walkExprPath(node, current)
                is PartiqlPhysical.Expr.Call -> walkExprCall(node, current)
                is PartiqlPhysical.Expr.Cast -> walkExprCast(node, current)
                is PartiqlPhysical.Expr.CanCast -> walkExprCanCast(node, current)
                is PartiqlPhysical.Expr.CanLosslessCast -> walkExprCanLosslessCast(node, current)
                is PartiqlPhysical.Expr.NullIf -> walkExprNullIf(node, current)
                is PartiqlPhysical.Expr.Coalesce -> walkExprCoalesce(node, current)
                is PartiqlPhysical.Expr.BindingsToValues -> walkExprBindingsToValues(node, current)
                is PartiqlPhysical.Expr.Struct -> walkExprStruct(node, current)
                is PartiqlPhysical.Expr.Pivot -> walkExprPivot(node, current)
                is PartiqlPhysical.Expr.LocalId -> walkExprLocalId(node, current)
                is PartiqlPhysical.Expr.GlobalId -> walkExprGlobalId(node, current)
            }
        }
    
        open fun walkExprMissing(node: PartiqlPhysical.Expr.Missing, accumulator: T): T {
            var current = accumulator
            current = visitExprMissing(node, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprLit(node: PartiqlPhysical.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 walkExprParameter(node: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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 walkExprBag(node: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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 walkExprCast(node: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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: PartiqlPhysical.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 walkExprBindingsToValues(node: PartiqlPhysical.Expr.BindingsToValues, accumulator: T): T {
            var current = accumulator
            current = visitExprBindingsToValues(node, current)
            current = walkExpr(node.exp, current)
            current = walkBexpr(node.query, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprStruct(node: PartiqlPhysical.Expr.Struct, accumulator: T): T {
            var current = accumulator
            current = visitExprStruct(node, current)
            node.parts.map { current = walkStructPart(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprPivot(node: PartiqlPhysical.Expr.Pivot, accumulator: T): T {
            var current = accumulator
            current = visitExprPivot(node, current)
            current = walkBexpr(node.input, current)
            current = walkExpr(node.key, current)
            current = walkExpr(node.value, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprLocalId(node: PartiqlPhysical.Expr.LocalId, accumulator: T): T {
            var current = accumulator
            current = visitExprLocalId(node, current)
            current = walkLongPrimitive(node.index, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkExprGlobalId(node: PartiqlPhysical.Expr.GlobalId, accumulator: T): T {
            var current = accumulator
            current = visitExprGlobalId(node, current)
            current = walkSymbolPrimitive(node.uniqueId, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: Statement
        //////////////////////////////////////
        open fun walkStatement(node: PartiqlPhysical.Statement, accumulator: T): T {
            val current = visitStatement(node, accumulator)
            return when(node) {
                is PartiqlPhysical.Statement.Query -> walkStatementQuery(node, current)
                is PartiqlPhysical.Statement.Exec -> walkStatementExec(node, current)
                is PartiqlPhysical.Statement.Explain -> walkStatementExplain(node, current)
                is PartiqlPhysical.Statement.DmlQuery -> walkStatementDmlQuery(node, current)
            }
        }
    
        open fun walkStatementQuery(node: PartiqlPhysical.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 walkStatementExec(node: PartiqlPhysical.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: PartiqlPhysical.Statement.Explain, accumulator: T): T {
            var current = accumulator
            current = visitStatementExplain(node, current)
            current = walkExplainTarget(node.target, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkStatementDmlQuery(node: PartiqlPhysical.Statement.DmlQuery, accumulator: T): T {
            var current = accumulator
            current = visitStatementDmlQuery(node, current)
            current = walkExpr(node.expr, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        //////////////////////////////////////
        // Sum Type: Bexpr
        //////////////////////////////////////
        open fun walkBexpr(node: PartiqlPhysical.Bexpr, accumulator: T): T {
            val current = visitBexpr(node, accumulator)
            return when(node) {
                is PartiqlPhysical.Bexpr.Project -> walkBexprProject(node, current)
                is PartiqlPhysical.Bexpr.Scan -> walkBexprScan(node, current)
                is PartiqlPhysical.Bexpr.Unpivot -> walkBexprUnpivot(node, current)
                is PartiqlPhysical.Bexpr.Filter -> walkBexprFilter(node, current)
                is PartiqlPhysical.Bexpr.Join -> walkBexprJoin(node, current)
                is PartiqlPhysical.Bexpr.Sort -> walkBexprSort(node, current)
                is PartiqlPhysical.Bexpr.Aggregate -> walkBexprAggregate(node, current)
                is PartiqlPhysical.Bexpr.Offset -> walkBexprOffset(node, current)
                is PartiqlPhysical.Bexpr.Limit -> walkBexprLimit(node, current)
                is PartiqlPhysical.Bexpr.Let -> walkBexprLet(node, current)
                is PartiqlPhysical.Bexpr.Window -> walkBexprWindow(node, current)
            }
        }
    
        open fun walkBexprProject(node: PartiqlPhysical.Bexpr.Project, accumulator: T): T {
            var current = accumulator
            current = visitBexprProject(node, current)
            current = walkImpl(node.i, current)
            current = walkVarDecl(node.binding, current)
            node.args.map { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBexprScan(node: PartiqlPhysical.Bexpr.Scan, accumulator: T): T {
            var current = accumulator
            current = visitBexprScan(node, current)
            current = walkImpl(node.i, current)
            current = walkExpr(node.expr, current)
            current = walkVarDecl(node.asDecl, current)
            node.atDecl?.let { current = walkVarDecl(it, current) }
            node.byDecl?.let { current = walkVarDecl(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBexprUnpivot(node: PartiqlPhysical.Bexpr.Unpivot, accumulator: T): T {
            var current = accumulator
            current = visitBexprUnpivot(node, current)
            current = walkImpl(node.i, current)
            current = walkExpr(node.expr, current)
            current = walkVarDecl(node.asDecl, current)
            node.atDecl?.let { current = walkVarDecl(it, current) }
            node.byDecl?.let { current = walkVarDecl(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBexprFilter(node: PartiqlPhysical.Bexpr.Filter, accumulator: T): T {
            var current = accumulator
            current = visitBexprFilter(node, current)
            current = walkImpl(node.i, current)
            current = walkExpr(node.predicate, current)
            current = walkBexpr(node.source, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBexprJoin(node: PartiqlPhysical.Bexpr.Join, accumulator: T): T {
            var current = accumulator
            current = visitBexprJoin(node, current)
            current = walkImpl(node.i, current)
            current = walkJoinType(node.joinType, current)
            current = walkBexpr(node.left, current)
            current = walkBexpr(node.right, current)
            node.predicate?.let { current = walkExpr(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBexprSort(node: PartiqlPhysical.Bexpr.Sort, accumulator: T): T {
            var current = accumulator
            current = visitBexprSort(node, current)
            current = walkImpl(node.i, current)
            current = walkBexpr(node.source, current)
            node.sortSpecs.map { current = walkSortSpec(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBexprAggregate(node: PartiqlPhysical.Bexpr.Aggregate, accumulator: T): T {
            var current = accumulator
            current = visitBexprAggregate(node, current)
            current = walkImpl(node.i, current)
            current = walkBexpr(node.source, current)
            current = walkGroupingStrategy(node.strategy, current)
            current = walkGroupKeyList(node.groupList, current)
            current = walkAggregateFunctionList(node.functionList, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBexprOffset(node: PartiqlPhysical.Bexpr.Offset, accumulator: T): T {
            var current = accumulator
            current = visitBexprOffset(node, current)
            current = walkImpl(node.i, current)
            current = walkExpr(node.rowCount, current)
            current = walkBexpr(node.source, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBexprLimit(node: PartiqlPhysical.Bexpr.Limit, accumulator: T): T {
            var current = accumulator
            current = visitBexprLimit(node, current)
            current = walkImpl(node.i, current)
            current = walkExpr(node.rowCount, current)
            current = walkBexpr(node.source, current)
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBexprLet(node: PartiqlPhysical.Bexpr.Let, accumulator: T): T {
            var current = accumulator
            current = visitBexprLet(node, current)
            current = walkImpl(node.i, current)
            current = walkBexpr(node.source, current)
            node.bindings.map { current = walkLetBinding(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
        open fun walkBexprWindow(node: PartiqlPhysical.Bexpr.Window, accumulator: T): T {
            var current = accumulator
            current = visitBexprWindow(node, current)
            current = walkImpl(node.i, current)
            current = walkBexpr(node.source, current)
            current = walkOver(node.windowSpecification, current)
            node.windowExpressionList.map { current = walkWindowExpression(it, current) }
            current = walkMetas(node.metas, current)
            return current
        }
    
    }
    abstract class VisitorTransform : DomainVisitorTransformBase() {
        //////////////////////////////////////
        // Tuple Types
        //////////////////////////////////////
        // Tuple TimeValue
        open fun transformTimeValue(node: PartiqlPhysical.TimeValue): PartiqlPhysical.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
            ) {
                PartiqlPhysical.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: PartiqlPhysical.TimeValue) =
            transformLongPrimitive(node.hour)
        open fun transformTimeValue_minute(node: PartiqlPhysical.TimeValue) =
            transformLongPrimitive(node.minute)
        open fun transformTimeValue_second(node: PartiqlPhysical.TimeValue) =
            transformLongPrimitive(node.second)
        open fun transformTimeValue_nano(node: PartiqlPhysical.TimeValue) =
            transformLongPrimitive(node.nano)
        open fun transformTimeValue_precision(node: PartiqlPhysical.TimeValue) =
            transformLongPrimitive(node.precision)
        open fun transformTimeValue_withTimeZone(node: PartiqlPhysical.TimeValue) =
            transformBoolPrimitive(node.withTimeZone)
        open fun transformTimeValue_tzMinutes(node: PartiqlPhysical.TimeValue) =
            node.tzMinutes?.let { transformLongPrimitive(it) }
        open fun transformTimeValue_metas(node: PartiqlPhysical.TimeValue) =
            transformMetas(node.metas)
    
        // Tuple GraphMatchQuantifier
        open fun transformGraphMatchQuantifier(node: PartiqlPhysical.GraphMatchQuantifier): PartiqlPhysical.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
            ) {
                PartiqlPhysical.GraphMatchQuantifier(
                    lower = new_lower,
                    upper = new_upper,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchQuantifier_lower(node: PartiqlPhysical.GraphMatchQuantifier) =
            transformLongPrimitive(node.lower)
        open fun transformGraphMatchQuantifier_upper(node: PartiqlPhysical.GraphMatchQuantifier) =
            node.upper?.let { transformLongPrimitive(it) }
        open fun transformGraphMatchQuantifier_metas(node: PartiqlPhysical.GraphMatchQuantifier) =
            transformMetas(node.metas)
    
        // Tuple GraphMatchPattern
        open fun transformGraphMatchPattern(node: PartiqlPhysical.GraphMatchPattern): PartiqlPhysical.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
            ) {
                PartiqlPhysical.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: PartiqlPhysical.GraphMatchPattern) =
            node.restrictor?.let { transformGraphMatchRestrictor(it) }
        open fun transformGraphMatchPattern_prefilter(node: PartiqlPhysical.GraphMatchPattern) =
            node.prefilter?.let { transformExpr(it) }
        open fun transformGraphMatchPattern_variable(node: PartiqlPhysical.GraphMatchPattern) =
            node.variable?.let { transformSymbolPrimitive(it) }
        open fun transformGraphMatchPattern_quantifier(node: PartiqlPhysical.GraphMatchPattern) =
            node.quantifier?.let { transformGraphMatchQuantifier(it) }
        open fun transformGraphMatchPattern_parts(node: PartiqlPhysical.GraphMatchPattern) =
            node.parts.map { transformGraphMatchPatternPart(it) }
        open fun transformGraphMatchPattern_metas(node: PartiqlPhysical.GraphMatchPattern) =
            transformMetas(node.metas)
    
        // Tuple GpmlPattern
        open fun transformGpmlPattern(node: PartiqlPhysical.GpmlPattern): PartiqlPhysical.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
            ) {
                PartiqlPhysical.GpmlPattern(
                    selector = new_selector,
                    patterns = new_patterns,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGpmlPattern_selector(node: PartiqlPhysical.GpmlPattern) =
            node.selector?.let { transformGraphMatchSelector(it) }
        open fun transformGpmlPattern_patterns(node: PartiqlPhysical.GpmlPattern) =
            node.patterns.map { transformGraphMatchPattern(it) }
        open fun transformGpmlPattern_metas(node: PartiqlPhysical.GpmlPattern) =
            transformMetas(node.metas)
    
        // Tuple ExprPair
        open fun transformExprPair(node: PartiqlPhysical.ExprPair): PartiqlPhysical.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
            ) {
                PartiqlPhysical.ExprPair(
                    first = new_first,
                    second = new_second,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprPair_first(node: PartiqlPhysical.ExprPair) =
            transformExpr(node.first)
        open fun transformExprPair_second(node: PartiqlPhysical.ExprPair) =
            transformExpr(node.second)
        open fun transformExprPair_metas(node: PartiqlPhysical.ExprPair) =
            transformMetas(node.metas)
    
        // Tuple ExprPairList
        open fun transformExprPairList(node: PartiqlPhysical.ExprPairList): PartiqlPhysical.ExprPairList {
            val new_pairs = transformExprPairList_pairs(node)
            val new_metas = transformExprPairList_metas(node)
            return if (
                node.pairs !== new_pairs ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.ExprPairList(
                    pairs = new_pairs,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprPairList_pairs(node: PartiqlPhysical.ExprPairList) =
            node.pairs.map { transformExprPair(it) }
        open fun transformExprPairList_metas(node: PartiqlPhysical.ExprPairList) =
            transformMetas(node.metas)
    
        // Tuple SortSpec
        open fun transformSortSpec(node: PartiqlPhysical.SortSpec): PartiqlPhysical.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
            ) {
                PartiqlPhysical.SortSpec(
                    expr = new_expr,
                    orderingSpec = new_orderingSpec,
                    nullsSpec = new_nullsSpec,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformSortSpec_expr(node: PartiqlPhysical.SortSpec) =
            transformExpr(node.expr)
        open fun transformSortSpec_orderingSpec(node: PartiqlPhysical.SortSpec) =
            node.orderingSpec?.let { transformOrderingSpec(it) }
        open fun transformSortSpec_nullsSpec(node: PartiqlPhysical.SortSpec) =
            node.nullsSpec?.let { transformNullsSpec(it) }
        open fun transformSortSpec_metas(node: PartiqlPhysical.SortSpec) =
            transformMetas(node.metas)
    
        // Tuple Over
        open fun transformOver(node: PartiqlPhysical.Over): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Over(
                    partitionBy = new_partitionBy,
                    orderBy = new_orderBy,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformOver_partitionBy(node: PartiqlPhysical.Over) =
            node.partitionBy?.let { transformWindowPartitionList(it) }
        open fun transformOver_orderBy(node: PartiqlPhysical.Over) =
            node.orderBy?.let { transformWindowSortSpecList(it) }
        open fun transformOver_metas(node: PartiqlPhysical.Over) =
            transformMetas(node.metas)
    
        // Tuple WindowPartitionList
        open fun transformWindowPartitionList(node: PartiqlPhysical.WindowPartitionList): PartiqlPhysical.WindowPartitionList {
            val new_exprs = transformWindowPartitionList_exprs(node)
            val new_metas = transformWindowPartitionList_metas(node)
            return if (
                node.exprs !== new_exprs ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.WindowPartitionList(
                    exprs = new_exprs,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformWindowPartitionList_exprs(node: PartiqlPhysical.WindowPartitionList) =
            node.exprs.map { transformExpr(it) }
        open fun transformWindowPartitionList_metas(node: PartiqlPhysical.WindowPartitionList) =
            transformMetas(node.metas)
    
        // Tuple WindowSortSpecList
        open fun transformWindowSortSpecList(node: PartiqlPhysical.WindowSortSpecList): PartiqlPhysical.WindowSortSpecList {
            val new_sortSpecs = transformWindowSortSpecList_sortSpecs(node)
            val new_metas = transformWindowSortSpecList_metas(node)
            return if (
                node.sortSpecs !== new_sortSpecs ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.WindowSortSpecList(
                    sortSpecs = new_sortSpecs,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformWindowSortSpecList_sortSpecs(node: PartiqlPhysical.WindowSortSpecList) =
            node.sortSpecs.map { transformSortSpec(it) }
        open fun transformWindowSortSpecList_metas(node: PartiqlPhysical.WindowSortSpecList) =
            transformMetas(node.metas)
    
        // Tuple Identifier
        open fun transformIdentifier(node: PartiqlPhysical.Identifier): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Identifier(
                    name = new_name,
                    case = new_case,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformIdentifier_name(node: PartiqlPhysical.Identifier) =
            transformSymbolPrimitive(node.name)
        open fun transformIdentifier_case(node: PartiqlPhysical.Identifier) =
            transformCaseSensitivity(node.case)
        open fun transformIdentifier_metas(node: PartiqlPhysical.Identifier) =
            transformMetas(node.metas)
    
        // Tuple LetBinding
        open fun transformLetBinding(node: PartiqlPhysical.LetBinding): PartiqlPhysical.LetBinding {
            val new_value = transformLetBinding_value(node)
            val new_decl = transformLetBinding_decl(node)
            val new_metas = transformLetBinding_metas(node)
            return if (
                node.value !== new_value ||
                node.decl !== new_decl ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.LetBinding(
                    value = new_value,
                    decl = new_decl,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformLetBinding_value(node: PartiqlPhysical.LetBinding) =
            transformExpr(node.value)
        open fun transformLetBinding_decl(node: PartiqlPhysical.LetBinding) =
            transformVarDecl(node.decl)
        open fun transformLetBinding_metas(node: PartiqlPhysical.LetBinding) =
            transformMetas(node.metas)
    
        // Tuple GroupKey
        open fun transformGroupKey(node: PartiqlPhysical.GroupKey): PartiqlPhysical.GroupKey {
            val new_expr = transformGroupKey_expr(node)
            val new_asVar = transformGroupKey_asVar(node)
            val new_metas = transformGroupKey_metas(node)
            return if (
                node.expr !== new_expr ||
                node.asVar !== new_asVar ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GroupKey(
                    expr = new_expr,
                    asVar = new_asVar,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGroupKey_expr(node: PartiqlPhysical.GroupKey) =
            transformExpr(node.expr)
        open fun transformGroupKey_asVar(node: PartiqlPhysical.GroupKey) =
            transformVarDecl(node.asVar)
        open fun transformGroupKey_metas(node: PartiqlPhysical.GroupKey) =
            transformMetas(node.metas)
    
        // Tuple GroupKeyList
        open fun transformGroupKeyList(node: PartiqlPhysical.GroupKeyList): PartiqlPhysical.GroupKeyList {
            val new_keys = transformGroupKeyList_keys(node)
            val new_metas = transformGroupKeyList_metas(node)
            return if (
                node.keys !== new_keys ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GroupKeyList(
                    keys = new_keys,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGroupKeyList_keys(node: PartiqlPhysical.GroupKeyList) =
            node.keys.map { transformGroupKey(it) }
        open fun transformGroupKeyList_metas(node: PartiqlPhysical.GroupKeyList) =
            transformMetas(node.metas)
    
        // Tuple AggregateFunction
        open fun transformAggregateFunction(node: PartiqlPhysical.AggregateFunction): PartiqlPhysical.AggregateFunction {
            val new_quantifier = transformAggregateFunction_quantifier(node)
            val new_name = transformAggregateFunction_name(node)
            val new_arg = transformAggregateFunction_arg(node)
            val new_asVar = transformAggregateFunction_asVar(node)
            val new_metas = transformAggregateFunction_metas(node)
            return if (
                node.quantifier !== new_quantifier ||
                node.name !== new_name ||
                node.arg !== new_arg ||
                node.asVar !== new_asVar ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.AggregateFunction(
                    quantifier = new_quantifier,
                    name = new_name,
                    arg = new_arg,
                    asVar = new_asVar,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformAggregateFunction_quantifier(node: PartiqlPhysical.AggregateFunction) =
            transformSetQuantifier(node.quantifier)
        open fun transformAggregateFunction_name(node: PartiqlPhysical.AggregateFunction) =
            transformSymbolPrimitive(node.name)
        open fun transformAggregateFunction_arg(node: PartiqlPhysical.AggregateFunction) =
            transformExpr(node.arg)
        open fun transformAggregateFunction_asVar(node: PartiqlPhysical.AggregateFunction) =
            transformVarDecl(node.asVar)
        open fun transformAggregateFunction_metas(node: PartiqlPhysical.AggregateFunction) =
            transformMetas(node.metas)
    
        // Tuple AggregateFunctionList
        open fun transformAggregateFunctionList(node: PartiqlPhysical.AggregateFunctionList): PartiqlPhysical.AggregateFunctionList {
            val new_functions = transformAggregateFunctionList_functions(node)
            val new_metas = transformAggregateFunctionList_metas(node)
            return if (
                node.functions !== new_functions ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.AggregateFunctionList(
                    functions = new_functions,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformAggregateFunctionList_functions(node: PartiqlPhysical.AggregateFunctionList) =
            node.functions.map { transformAggregateFunction(it) }
        open fun transformAggregateFunctionList_metas(node: PartiqlPhysical.AggregateFunctionList) =
            transformMetas(node.metas)
    
        // Tuple WindowExpression
        open fun transformWindowExpression(node: PartiqlPhysical.WindowExpression): PartiqlPhysical.WindowExpression {
            val new_decl = transformWindowExpression_decl(node)
            val new_funcName = transformWindowExpression_funcName(node)
            val new_args = transformWindowExpression_args(node)
            val new_metas = transformWindowExpression_metas(node)
            return if (
                node.decl !== new_decl ||
                node.funcName !== new_funcName ||
                node.args !== new_args ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.WindowExpression(
                    decl = new_decl,
                    funcName = new_funcName,
                    args = new_args,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformWindowExpression_decl(node: PartiqlPhysical.WindowExpression) =
            transformVarDecl(node.decl)
        open fun transformWindowExpression_funcName(node: PartiqlPhysical.WindowExpression) =
            transformSymbolPrimitive(node.funcName)
        open fun transformWindowExpression_args(node: PartiqlPhysical.WindowExpression) =
            node.args.map { transformExpr(it) }
        open fun transformWindowExpression_metas(node: PartiqlPhysical.WindowExpression) =
            transformMetas(node.metas)
    
        // Tuple Plan
        open fun transformPlan(node: PartiqlPhysical.Plan): PartiqlPhysical.Plan {
            val new_stmt = transformPlan_stmt(node)
            val new_version = transformPlan_version(node)
            val new_locals = transformPlan_locals(node)
            val new_metas = transformPlan_metas(node)
            return if (
                node.stmt !== new_stmt ||
                node.version !== new_version ||
                node.locals !== new_locals ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Plan(
                    stmt = new_stmt,
                    version = new_version,
                    locals = new_locals,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformPlan_stmt(node: PartiqlPhysical.Plan) =
            transformStatement(node.stmt)
        open fun transformPlan_version(node: PartiqlPhysical.Plan) =
            transformSymbolPrimitive(node.version)
        open fun transformPlan_locals(node: PartiqlPhysical.Plan) =
            node.locals.map { transformLocalVariable(it) }
        open fun transformPlan_metas(node: PartiqlPhysical.Plan) =
            transformMetas(node.metas)
    
        // Tuple LocalVariable
        open fun transformLocalVariable(node: PartiqlPhysical.LocalVariable): PartiqlPhysical.LocalVariable {
            val new_name = transformLocalVariable_name(node)
            val new_registerIndex = transformLocalVariable_registerIndex(node)
            val new_metas = transformLocalVariable_metas(node)
            return if (
                node.name !== new_name ||
                node.registerIndex !== new_registerIndex ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.LocalVariable(
                    name = new_name,
                    registerIndex = new_registerIndex,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformLocalVariable_name(node: PartiqlPhysical.LocalVariable) =
            transformSymbolPrimitive(node.name)
        open fun transformLocalVariable_registerIndex(node: PartiqlPhysical.LocalVariable) =
            transformLongPrimitive(node.registerIndex)
        open fun transformLocalVariable_metas(node: PartiqlPhysical.LocalVariable) =
            transformMetas(node.metas)
    
        // Tuple VarDecl
        open fun transformVarDecl(node: PartiqlPhysical.VarDecl): PartiqlPhysical.VarDecl {
            val new_index = transformVarDecl_index(node)
            val new_metas = transformVarDecl_metas(node)
            return if (
                node.index !== new_index ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.VarDecl(
                    index = new_index,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformVarDecl_index(node: PartiqlPhysical.VarDecl) =
            transformLongPrimitive(node.index)
        open fun transformVarDecl_metas(node: PartiqlPhysical.VarDecl) =
            transformMetas(node.metas)
    
        // Tuple Impl
        open fun transformImpl(node: PartiqlPhysical.Impl): PartiqlPhysical.Impl {
            val new_name = transformImpl_name(node)
            val new_staticArgs = transformImpl_staticArgs(node)
            val new_metas = transformImpl_metas(node)
            return if (
                node.name !== new_name ||
                node.staticArgs !== new_staticArgs ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Impl(
                    name = new_name,
                    staticArgs = new_staticArgs,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformImpl_name(node: PartiqlPhysical.Impl) =
            transformSymbolPrimitive(node.name)
        open fun transformImpl_staticArgs(node: PartiqlPhysical.Impl) =
            node.staticArgs.map { transformAnyElement(it) }
        open fun transformImpl_metas(node: PartiqlPhysical.Impl) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: ExplainTarget
        //////////////////////////////////////
        open fun transformExplainTarget(node: PartiqlPhysical.ExplainTarget): PartiqlPhysical.ExplainTarget =
            when(node) {
                is PartiqlPhysical.ExplainTarget.Domain -> transformExplainTargetDomain(node)
            }
        // Variant ExplainTargetDomain
        open fun transformExplainTargetDomain(node: PartiqlPhysical.ExplainTarget.Domain): PartiqlPhysical.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
            ) {
                PartiqlPhysical.ExplainTarget.Domain(
                    statement = new_statement,
                    type = new_type,
                    format = new_format,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExplainTargetDomain_statement(node: PartiqlPhysical.ExplainTarget.Domain) =
            transformStatement(node.statement)
        open fun transformExplainTargetDomain_type(node: PartiqlPhysical.ExplainTarget.Domain) =
            node.type?.let { transformSymbolPrimitive(it) }
        open fun transformExplainTargetDomain_format(node: PartiqlPhysical.ExplainTarget.Domain) =
            node.format?.let { transformSymbolPrimitive(it) }
        open fun transformExplainTargetDomain_metas(node: PartiqlPhysical.ExplainTarget.Domain) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: PathStep
        //////////////////////////////////////
        open fun transformPathStep(node: PartiqlPhysical.PathStep): PartiqlPhysical.PathStep =
            when(node) {
                is PartiqlPhysical.PathStep.PathExpr -> transformPathStepPathExpr(node)
                is PartiqlPhysical.PathStep.PathWildcard -> transformPathStepPathWildcard(node)
                is PartiqlPhysical.PathStep.PathUnpivot -> transformPathStepPathUnpivot(node)
            }
        // Variant PathStepPathExpr
        open fun transformPathStepPathExpr(node: PartiqlPhysical.PathStep.PathExpr): PartiqlPhysical.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
            ) {
                PartiqlPhysical.PathStep.PathExpr(
                    index = new_index,
                    case = new_case,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformPathStepPathExpr_index(node: PartiqlPhysical.PathStep.PathExpr) =
            transformExpr(node.index)
        open fun transformPathStepPathExpr_case(node: PartiqlPhysical.PathStep.PathExpr) =
            transformCaseSensitivity(node.case)
        open fun transformPathStepPathExpr_metas(node: PartiqlPhysical.PathStep.PathExpr) =
            transformMetas(node.metas)
    
        // Variant PathStepPathWildcard
        open fun transformPathStepPathWildcard(node: PartiqlPhysical.PathStep.PathWildcard): PartiqlPhysical.PathStep {
            val new_metas = transformPathStepPathWildcard_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.PathStep.PathWildcard(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformPathStepPathWildcard_metas(node: PartiqlPhysical.PathStep.PathWildcard) =
            transformMetas(node.metas)
    
        // Variant PathStepPathUnpivot
        open fun transformPathStepPathUnpivot(node: PartiqlPhysical.PathStep.PathUnpivot): PartiqlPhysical.PathStep {
            val new_metas = transformPathStepPathUnpivot_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.PathStep.PathUnpivot(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformPathStepPathUnpivot_metas(node: PartiqlPhysical.PathStep.PathUnpivot) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: JoinType
        //////////////////////////////////////
        open fun transformJoinType(node: PartiqlPhysical.JoinType): PartiqlPhysical.JoinType =
            when(node) {
                is PartiqlPhysical.JoinType.Inner -> transformJoinTypeInner(node)
                is PartiqlPhysical.JoinType.Left -> transformJoinTypeLeft(node)
                is PartiqlPhysical.JoinType.Right -> transformJoinTypeRight(node)
                is PartiqlPhysical.JoinType.Full -> transformJoinTypeFull(node)
            }
        // Variant JoinTypeInner
        open fun transformJoinTypeInner(node: PartiqlPhysical.JoinType.Inner): PartiqlPhysical.JoinType {
            val new_metas = transformJoinTypeInner_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.JoinType.Inner(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformJoinTypeInner_metas(node: PartiqlPhysical.JoinType.Inner) =
            transformMetas(node.metas)
    
        // Variant JoinTypeLeft
        open fun transformJoinTypeLeft(node: PartiqlPhysical.JoinType.Left): PartiqlPhysical.JoinType {
            val new_metas = transformJoinTypeLeft_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.JoinType.Left(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformJoinTypeLeft_metas(node: PartiqlPhysical.JoinType.Left) =
            transformMetas(node.metas)
    
        // Variant JoinTypeRight
        open fun transformJoinTypeRight(node: PartiqlPhysical.JoinType.Right): PartiqlPhysical.JoinType {
            val new_metas = transformJoinTypeRight_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.JoinType.Right(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformJoinTypeRight_metas(node: PartiqlPhysical.JoinType.Right) =
            transformMetas(node.metas)
    
        // Variant JoinTypeFull
        open fun transformJoinTypeFull(node: PartiqlPhysical.JoinType.Full): PartiqlPhysical.JoinType {
            val new_metas = transformJoinTypeFull_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.JoinType.Full(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformJoinTypeFull_metas(node: PartiqlPhysical.JoinType.Full) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: GraphMatchDirection
        //////////////////////////////////////
        open fun transformGraphMatchDirection(node: PartiqlPhysical.GraphMatchDirection): PartiqlPhysical.GraphMatchDirection =
            when(node) {
                is PartiqlPhysical.GraphMatchDirection.EdgeLeft -> transformGraphMatchDirectionEdgeLeft(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeUndirected -> transformGraphMatchDirectionEdgeUndirected(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeRight -> transformGraphMatchDirectionEdgeRight(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected -> transformGraphMatchDirectionEdgeLeftOrUndirected(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight -> transformGraphMatchDirectionEdgeUndirectedOrRight(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight -> transformGraphMatchDirectionEdgeLeftOrRight(node)
                is PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight -> transformGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node)
            }
        // Variant GraphMatchDirectionEdgeLeft
        open fun transformGraphMatchDirectionEdgeLeft(node: PartiqlPhysical.GraphMatchDirection.EdgeLeft): PartiqlPhysical.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeLeft_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchDirection.EdgeLeft(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeLeft_metas(node: PartiqlPhysical.GraphMatchDirection.EdgeLeft) =
            transformMetas(node.metas)
    
        // Variant GraphMatchDirectionEdgeUndirected
        open fun transformGraphMatchDirectionEdgeUndirected(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirected): PartiqlPhysical.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeUndirected_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchDirection.EdgeUndirected(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeUndirected_metas(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirected) =
            transformMetas(node.metas)
    
        // Variant GraphMatchDirectionEdgeRight
        open fun transformGraphMatchDirectionEdgeRight(node: PartiqlPhysical.GraphMatchDirection.EdgeRight): PartiqlPhysical.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeRight_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchDirection.EdgeRight(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeRight_metas(node: PartiqlPhysical.GraphMatchDirection.EdgeRight) =
            transformMetas(node.metas)
    
        // Variant GraphMatchDirectionEdgeLeftOrUndirected
        open fun transformGraphMatchDirectionEdgeLeftOrUndirected(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected): PartiqlPhysical.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeLeftOrUndirected_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeLeftOrUndirected_metas(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirected) =
            transformMetas(node.metas)
    
        // Variant GraphMatchDirectionEdgeUndirectedOrRight
        open fun transformGraphMatchDirectionEdgeUndirectedOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight): PartiqlPhysical.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeUndirectedOrRight_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeUndirectedOrRight_metas(node: PartiqlPhysical.GraphMatchDirection.EdgeUndirectedOrRight) =
            transformMetas(node.metas)
    
        // Variant GraphMatchDirectionEdgeLeftOrRight
        open fun transformGraphMatchDirectionEdgeLeftOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight): PartiqlPhysical.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeLeftOrRight_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeLeftOrRight_metas(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrRight) =
            transformMetas(node.metas)
    
        // Variant GraphMatchDirectionEdgeLeftOrUndirectedOrRight
        open fun transformGraphMatchDirectionEdgeLeftOrUndirectedOrRight(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight): PartiqlPhysical.GraphMatchDirection {
            val new_metas = transformGraphMatchDirectionEdgeLeftOrUndirectedOrRight_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchDirectionEdgeLeftOrUndirectedOrRight_metas(node: PartiqlPhysical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: GraphMatchPatternPart
        //////////////////////////////////////
        open fun transformGraphMatchPatternPart(node: PartiqlPhysical.GraphMatchPatternPart): PartiqlPhysical.GraphMatchPatternPart =
            when(node) {
                is PartiqlPhysical.GraphMatchPatternPart.Node -> transformGraphMatchPatternPartNode(node)
                is PartiqlPhysical.GraphMatchPatternPart.Edge -> transformGraphMatchPatternPartEdge(node)
                is PartiqlPhysical.GraphMatchPatternPart.Pattern -> transformGraphMatchPatternPartPattern(node)
            }
        // Variant GraphMatchPatternPartNode
        open fun transformGraphMatchPatternPartNode(node: PartiqlPhysical.GraphMatchPatternPart.Node): PartiqlPhysical.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
            ) {
                PartiqlPhysical.GraphMatchPatternPart.Node(
                    prefilter = new_prefilter,
                    variable = new_variable,
                    label = new_label,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchPatternPartNode_prefilter(node: PartiqlPhysical.GraphMatchPatternPart.Node) =
            node.prefilter?.let { transformExpr(it) }
        open fun transformGraphMatchPatternPartNode_variable(node: PartiqlPhysical.GraphMatchPatternPart.Node) =
            node.variable?.let { transformSymbolPrimitive(it) }
        open fun transformGraphMatchPatternPartNode_label(node: PartiqlPhysical.GraphMatchPatternPart.Node) =
            node.label.map { transformSymbolPrimitive(it) }
        open fun transformGraphMatchPatternPartNode_metas(node: PartiqlPhysical.GraphMatchPatternPart.Node) =
            transformMetas(node.metas)
    
        // Variant GraphMatchPatternPartEdge
        open fun transformGraphMatchPatternPartEdge(node: PartiqlPhysical.GraphMatchPatternPart.Edge): PartiqlPhysical.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
            ) {
                PartiqlPhysical.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: PartiqlPhysical.GraphMatchPatternPart.Edge) =
            transformGraphMatchDirection(node.direction)
        open fun transformGraphMatchPatternPartEdge_quantifier(node: PartiqlPhysical.GraphMatchPatternPart.Edge) =
            node.quantifier?.let { transformGraphMatchQuantifier(it) }
        open fun transformGraphMatchPatternPartEdge_prefilter(node: PartiqlPhysical.GraphMatchPatternPart.Edge) =
            node.prefilter?.let { transformExpr(it) }
        open fun transformGraphMatchPatternPartEdge_variable(node: PartiqlPhysical.GraphMatchPatternPart.Edge) =
            node.variable?.let { transformSymbolPrimitive(it) }
        open fun transformGraphMatchPatternPartEdge_label(node: PartiqlPhysical.GraphMatchPatternPart.Edge) =
            node.label.map { transformSymbolPrimitive(it) }
        open fun transformGraphMatchPatternPartEdge_metas(node: PartiqlPhysical.GraphMatchPatternPart.Edge) =
            transformMetas(node.metas)
    
        // Variant GraphMatchPatternPartPattern
        open fun transformGraphMatchPatternPartPattern(node: PartiqlPhysical.GraphMatchPatternPart.Pattern): PartiqlPhysical.GraphMatchPatternPart {
            val new_pattern = transformGraphMatchPatternPartPattern_pattern(node)
            val new_metas = transformGraphMatchPatternPartPattern_metas(node)
            return if (
                node.pattern !== new_pattern ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchPatternPart.Pattern(
                    pattern = new_pattern,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchPatternPartPattern_pattern(node: PartiqlPhysical.GraphMatchPatternPart.Pattern) =
            transformGraphMatchPattern(node.pattern)
        open fun transformGraphMatchPatternPartPattern_metas(node: PartiqlPhysical.GraphMatchPatternPart.Pattern) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: GraphMatchRestrictor
        //////////////////////////////////////
        open fun transformGraphMatchRestrictor(node: PartiqlPhysical.GraphMatchRestrictor): PartiqlPhysical.GraphMatchRestrictor =
            when(node) {
                is PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail -> transformGraphMatchRestrictorRestrictorTrail(node)
                is PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic -> transformGraphMatchRestrictorRestrictorAcyclic(node)
                is PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple -> transformGraphMatchRestrictorRestrictorSimple(node)
            }
        // Variant GraphMatchRestrictorRestrictorTrail
        open fun transformGraphMatchRestrictorRestrictorTrail(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail): PartiqlPhysical.GraphMatchRestrictor {
            val new_metas = transformGraphMatchRestrictorRestrictorTrail_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchRestrictorRestrictorTrail_metas(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorTrail) =
            transformMetas(node.metas)
    
        // Variant GraphMatchRestrictorRestrictorAcyclic
        open fun transformGraphMatchRestrictorRestrictorAcyclic(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic): PartiqlPhysical.GraphMatchRestrictor {
            val new_metas = transformGraphMatchRestrictorRestrictorAcyclic_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchRestrictorRestrictorAcyclic_metas(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorAcyclic) =
            transformMetas(node.metas)
    
        // Variant GraphMatchRestrictorRestrictorSimple
        open fun transformGraphMatchRestrictorRestrictorSimple(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple): PartiqlPhysical.GraphMatchRestrictor {
            val new_metas = transformGraphMatchRestrictorRestrictorSimple_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchRestrictorRestrictorSimple_metas(node: PartiqlPhysical.GraphMatchRestrictor.RestrictorSimple) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: GraphMatchSelector
        //////////////////////////////////////
        open fun transformGraphMatchSelector(node: PartiqlPhysical.GraphMatchSelector): PartiqlPhysical.GraphMatchSelector =
            when(node) {
                is PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest -> transformGraphMatchSelectorSelectorAnyShortest(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorAllShortest -> transformGraphMatchSelectorSelectorAllShortest(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorAny -> transformGraphMatchSelectorSelectorAny(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorAnyK -> transformGraphMatchSelectorSelectorAnyK(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorShortestK -> transformGraphMatchSelectorSelectorShortestK(node)
                is PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup -> transformGraphMatchSelectorSelectorShortestKGroup(node)
            }
        // Variant GraphMatchSelectorSelectorAnyShortest
        open fun transformGraphMatchSelectorSelectorAnyShortest(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest): PartiqlPhysical.GraphMatchSelector {
            val new_metas = transformGraphMatchSelectorSelectorAnyShortest_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchSelectorSelectorAnyShortest_metas(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyShortest) =
            transformMetas(node.metas)
    
        // Variant GraphMatchSelectorSelectorAllShortest
        open fun transformGraphMatchSelectorSelectorAllShortest(node: PartiqlPhysical.GraphMatchSelector.SelectorAllShortest): PartiqlPhysical.GraphMatchSelector {
            val new_metas = transformGraphMatchSelectorSelectorAllShortest_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchSelector.SelectorAllShortest(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchSelectorSelectorAllShortest_metas(node: PartiqlPhysical.GraphMatchSelector.SelectorAllShortest) =
            transformMetas(node.metas)
    
        // Variant GraphMatchSelectorSelectorAny
        open fun transformGraphMatchSelectorSelectorAny(node: PartiqlPhysical.GraphMatchSelector.SelectorAny): PartiqlPhysical.GraphMatchSelector {
            val new_metas = transformGraphMatchSelectorSelectorAny_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchSelector.SelectorAny(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchSelectorSelectorAny_metas(node: PartiqlPhysical.GraphMatchSelector.SelectorAny) =
            transformMetas(node.metas)
    
        // Variant GraphMatchSelectorSelectorAnyK
        open fun transformGraphMatchSelectorSelectorAnyK(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyK): PartiqlPhysical.GraphMatchSelector {
            val new_k = transformGraphMatchSelectorSelectorAnyK_k(node)
            val new_metas = transformGraphMatchSelectorSelectorAnyK_metas(node)
            return if (
                node.k !== new_k ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchSelector.SelectorAnyK(
                    k = new_k,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchSelectorSelectorAnyK_k(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyK) =
            transformLongPrimitive(node.k)
        open fun transformGraphMatchSelectorSelectorAnyK_metas(node: PartiqlPhysical.GraphMatchSelector.SelectorAnyK) =
            transformMetas(node.metas)
    
        // Variant GraphMatchSelectorSelectorShortestK
        open fun transformGraphMatchSelectorSelectorShortestK(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestK): PartiqlPhysical.GraphMatchSelector {
            val new_k = transformGraphMatchSelectorSelectorShortestK_k(node)
            val new_metas = transformGraphMatchSelectorSelectorShortestK_metas(node)
            return if (
                node.k !== new_k ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchSelector.SelectorShortestK(
                    k = new_k,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchSelectorSelectorShortestK_k(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestK) =
            transformLongPrimitive(node.k)
        open fun transformGraphMatchSelectorSelectorShortestK_metas(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestK) =
            transformMetas(node.metas)
    
        // Variant GraphMatchSelectorSelectorShortestKGroup
        open fun transformGraphMatchSelectorSelectorShortestKGroup(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup): PartiqlPhysical.GraphMatchSelector {
            val new_k = transformGraphMatchSelectorSelectorShortestKGroup_k(node)
            val new_metas = transformGraphMatchSelectorSelectorShortestKGroup_metas(node)
            return if (
                node.k !== new_k ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup(
                    k = new_k,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGraphMatchSelectorSelectorShortestKGroup_k(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup) =
            transformLongPrimitive(node.k)
        open fun transformGraphMatchSelectorSelectorShortestKGroup_metas(node: PartiqlPhysical.GraphMatchSelector.SelectorShortestKGroup) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: GroupingStrategy
        //////////////////////////////////////
        open fun transformGroupingStrategy(node: PartiqlPhysical.GroupingStrategy): PartiqlPhysical.GroupingStrategy =
            when(node) {
                is PartiqlPhysical.GroupingStrategy.GroupFull -> transformGroupingStrategyGroupFull(node)
                is PartiqlPhysical.GroupingStrategy.GroupPartial -> transformGroupingStrategyGroupPartial(node)
            }
        // Variant GroupingStrategyGroupFull
        open fun transformGroupingStrategyGroupFull(node: PartiqlPhysical.GroupingStrategy.GroupFull): PartiqlPhysical.GroupingStrategy {
            val new_metas = transformGroupingStrategyGroupFull_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GroupingStrategy.GroupFull(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGroupingStrategyGroupFull_metas(node: PartiqlPhysical.GroupingStrategy.GroupFull) =
            transformMetas(node.metas)
    
        // Variant GroupingStrategyGroupPartial
        open fun transformGroupingStrategyGroupPartial(node: PartiqlPhysical.GroupingStrategy.GroupPartial): PartiqlPhysical.GroupingStrategy {
            val new_metas = transformGroupingStrategyGroupPartial_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.GroupingStrategy.GroupPartial(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformGroupingStrategyGroupPartial_metas(node: PartiqlPhysical.GroupingStrategy.GroupPartial) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: OrderingSpec
        //////////////////////////////////////
        open fun transformOrderingSpec(node: PartiqlPhysical.OrderingSpec): PartiqlPhysical.OrderingSpec =
            when(node) {
                is PartiqlPhysical.OrderingSpec.Asc -> transformOrderingSpecAsc(node)
                is PartiqlPhysical.OrderingSpec.Desc -> transformOrderingSpecDesc(node)
            }
        // Variant OrderingSpecAsc
        open fun transformOrderingSpecAsc(node: PartiqlPhysical.OrderingSpec.Asc): PartiqlPhysical.OrderingSpec {
            val new_metas = transformOrderingSpecAsc_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.OrderingSpec.Asc(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformOrderingSpecAsc_metas(node: PartiqlPhysical.OrderingSpec.Asc) =
            transformMetas(node.metas)
    
        // Variant OrderingSpecDesc
        open fun transformOrderingSpecDesc(node: PartiqlPhysical.OrderingSpec.Desc): PartiqlPhysical.OrderingSpec {
            val new_metas = transformOrderingSpecDesc_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.OrderingSpec.Desc(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformOrderingSpecDesc_metas(node: PartiqlPhysical.OrderingSpec.Desc) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: NullsSpec
        //////////////////////////////////////
        open fun transformNullsSpec(node: PartiqlPhysical.NullsSpec): PartiqlPhysical.NullsSpec =
            when(node) {
                is PartiqlPhysical.NullsSpec.NullsFirst -> transformNullsSpecNullsFirst(node)
                is PartiqlPhysical.NullsSpec.NullsLast -> transformNullsSpecNullsLast(node)
            }
        // Variant NullsSpecNullsFirst
        open fun transformNullsSpecNullsFirst(node: PartiqlPhysical.NullsSpec.NullsFirst): PartiqlPhysical.NullsSpec {
            val new_metas = transformNullsSpecNullsFirst_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.NullsSpec.NullsFirst(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformNullsSpecNullsFirst_metas(node: PartiqlPhysical.NullsSpec.NullsFirst) =
            transformMetas(node.metas)
    
        // Variant NullsSpecNullsLast
        open fun transformNullsSpecNullsLast(node: PartiqlPhysical.NullsSpec.NullsLast): PartiqlPhysical.NullsSpec {
            val new_metas = transformNullsSpecNullsLast_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.NullsSpec.NullsLast(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformNullsSpecNullsLast_metas(node: PartiqlPhysical.NullsSpec.NullsLast) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: CaseSensitivity
        //////////////////////////////////////
        open fun transformCaseSensitivity(node: PartiqlPhysical.CaseSensitivity): PartiqlPhysical.CaseSensitivity =
            when(node) {
                is PartiqlPhysical.CaseSensitivity.CaseSensitive -> transformCaseSensitivityCaseSensitive(node)
                is PartiqlPhysical.CaseSensitivity.CaseInsensitive -> transformCaseSensitivityCaseInsensitive(node)
            }
        // Variant CaseSensitivityCaseSensitive
        open fun transformCaseSensitivityCaseSensitive(node: PartiqlPhysical.CaseSensitivity.CaseSensitive): PartiqlPhysical.CaseSensitivity {
            val new_metas = transformCaseSensitivityCaseSensitive_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.CaseSensitivity.CaseSensitive(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformCaseSensitivityCaseSensitive_metas(node: PartiqlPhysical.CaseSensitivity.CaseSensitive) =
            transformMetas(node.metas)
    
        // Variant CaseSensitivityCaseInsensitive
        open fun transformCaseSensitivityCaseInsensitive(node: PartiqlPhysical.CaseSensitivity.CaseInsensitive): PartiqlPhysical.CaseSensitivity {
            val new_metas = transformCaseSensitivityCaseInsensitive_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.CaseSensitivity.CaseInsensitive(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformCaseSensitivityCaseInsensitive_metas(node: PartiqlPhysical.CaseSensitivity.CaseInsensitive) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: SetQuantifier
        //////////////////////////////////////
        open fun transformSetQuantifier(node: PartiqlPhysical.SetQuantifier): PartiqlPhysical.SetQuantifier =
            when(node) {
                is PartiqlPhysical.SetQuantifier.All -> transformSetQuantifierAll(node)
                is PartiqlPhysical.SetQuantifier.Distinct -> transformSetQuantifierDistinct(node)
            }
        // Variant SetQuantifierAll
        open fun transformSetQuantifierAll(node: PartiqlPhysical.SetQuantifier.All): PartiqlPhysical.SetQuantifier {
            val new_metas = transformSetQuantifierAll_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.SetQuantifier.All(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformSetQuantifierAll_metas(node: PartiqlPhysical.SetQuantifier.All) =
            transformMetas(node.metas)
    
        // Variant SetQuantifierDistinct
        open fun transformSetQuantifierDistinct(node: PartiqlPhysical.SetQuantifier.Distinct): PartiqlPhysical.SetQuantifier {
            val new_metas = transformSetQuantifierDistinct_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.SetQuantifier.Distinct(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformSetQuantifierDistinct_metas(node: PartiqlPhysical.SetQuantifier.Distinct) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: BagOpType
        //////////////////////////////////////
        open fun transformBagOpType(node: PartiqlPhysical.BagOpType): PartiqlPhysical.BagOpType =
            when(node) {
                is PartiqlPhysical.BagOpType.Union -> transformBagOpTypeUnion(node)
                is PartiqlPhysical.BagOpType.Intersect -> transformBagOpTypeIntersect(node)
                is PartiqlPhysical.BagOpType.Except -> transformBagOpTypeExcept(node)
                is PartiqlPhysical.BagOpType.OuterUnion -> transformBagOpTypeOuterUnion(node)
                is PartiqlPhysical.BagOpType.OuterIntersect -> transformBagOpTypeOuterIntersect(node)
                is PartiqlPhysical.BagOpType.OuterExcept -> transformBagOpTypeOuterExcept(node)
            }
        // Variant BagOpTypeUnion
        open fun transformBagOpTypeUnion(node: PartiqlPhysical.BagOpType.Union): PartiqlPhysical.BagOpType {
            val new_metas = transformBagOpTypeUnion_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.BagOpType.Union(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBagOpTypeUnion_metas(node: PartiqlPhysical.BagOpType.Union) =
            transformMetas(node.metas)
    
        // Variant BagOpTypeIntersect
        open fun transformBagOpTypeIntersect(node: PartiqlPhysical.BagOpType.Intersect): PartiqlPhysical.BagOpType {
            val new_metas = transformBagOpTypeIntersect_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.BagOpType.Intersect(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBagOpTypeIntersect_metas(node: PartiqlPhysical.BagOpType.Intersect) =
            transformMetas(node.metas)
    
        // Variant BagOpTypeExcept
        open fun transformBagOpTypeExcept(node: PartiqlPhysical.BagOpType.Except): PartiqlPhysical.BagOpType {
            val new_metas = transformBagOpTypeExcept_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.BagOpType.Except(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBagOpTypeExcept_metas(node: PartiqlPhysical.BagOpType.Except) =
            transformMetas(node.metas)
    
        // Variant BagOpTypeOuterUnion
        open fun transformBagOpTypeOuterUnion(node: PartiqlPhysical.BagOpType.OuterUnion): PartiqlPhysical.BagOpType {
            val new_metas = transformBagOpTypeOuterUnion_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.BagOpType.OuterUnion(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBagOpTypeOuterUnion_metas(node: PartiqlPhysical.BagOpType.OuterUnion) =
            transformMetas(node.metas)
    
        // Variant BagOpTypeOuterIntersect
        open fun transformBagOpTypeOuterIntersect(node: PartiqlPhysical.BagOpType.OuterIntersect): PartiqlPhysical.BagOpType {
            val new_metas = transformBagOpTypeOuterIntersect_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.BagOpType.OuterIntersect(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBagOpTypeOuterIntersect_metas(node: PartiqlPhysical.BagOpType.OuterIntersect) =
            transformMetas(node.metas)
    
        // Variant BagOpTypeOuterExcept
        open fun transformBagOpTypeOuterExcept(node: PartiqlPhysical.BagOpType.OuterExcept): PartiqlPhysical.BagOpType {
            val new_metas = transformBagOpTypeOuterExcept_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.BagOpType.OuterExcept(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBagOpTypeOuterExcept_metas(node: PartiqlPhysical.BagOpType.OuterExcept) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: OnConflictValue
        //////////////////////////////////////
        open fun transformOnConflictValue(node: PartiqlPhysical.OnConflictValue): PartiqlPhysical.OnConflictValue =
            when(node) {
                is PartiqlPhysical.OnConflictValue.Excluded -> transformOnConflictValueExcluded(node)
            }
        // Variant OnConflictValueExcluded
        open fun transformOnConflictValueExcluded(node: PartiqlPhysical.OnConflictValue.Excluded): PartiqlPhysical.OnConflictValue {
            val new_metas = transformOnConflictValueExcluded_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.OnConflictValue.Excluded(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformOnConflictValueExcluded_metas(node: PartiqlPhysical.OnConflictValue.Excluded) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: Type
        //////////////////////////////////////
        open fun transformType(node: PartiqlPhysical.Type): PartiqlPhysical.Type =
            when(node) {
                is PartiqlPhysical.Type.NullType -> transformTypeNullType(node)
                is PartiqlPhysical.Type.BooleanType -> transformTypeBooleanType(node)
                is PartiqlPhysical.Type.SmallintType -> transformTypeSmallintType(node)
                is PartiqlPhysical.Type.Integer4Type -> transformTypeInteger4Type(node)
                is PartiqlPhysical.Type.Integer8Type -> transformTypeInteger8Type(node)
                is PartiqlPhysical.Type.IntegerType -> transformTypeIntegerType(node)
                is PartiqlPhysical.Type.FloatType -> transformTypeFloatType(node)
                is PartiqlPhysical.Type.RealType -> transformTypeRealType(node)
                is PartiqlPhysical.Type.DoublePrecisionType -> transformTypeDoublePrecisionType(node)
                is PartiqlPhysical.Type.DecimalType -> transformTypeDecimalType(node)
                is PartiqlPhysical.Type.NumericType -> transformTypeNumericType(node)
                is PartiqlPhysical.Type.TimestampType -> transformTypeTimestampType(node)
                is PartiqlPhysical.Type.CharacterType -> transformTypeCharacterType(node)
                is PartiqlPhysical.Type.CharacterVaryingType -> transformTypeCharacterVaryingType(node)
                is PartiqlPhysical.Type.MissingType -> transformTypeMissingType(node)
                is PartiqlPhysical.Type.StringType -> transformTypeStringType(node)
                is PartiqlPhysical.Type.SymbolType -> transformTypeSymbolType(node)
                is PartiqlPhysical.Type.BlobType -> transformTypeBlobType(node)
                is PartiqlPhysical.Type.ClobType -> transformTypeClobType(node)
                is PartiqlPhysical.Type.DateType -> transformTypeDateType(node)
                is PartiqlPhysical.Type.TimeType -> transformTypeTimeType(node)
                is PartiqlPhysical.Type.TimeWithTimeZoneType -> transformTypeTimeWithTimeZoneType(node)
                is PartiqlPhysical.Type.StructType -> transformTypeStructType(node)
                is PartiqlPhysical.Type.TupleType -> transformTypeTupleType(node)
                is PartiqlPhysical.Type.ListType -> transformTypeListType(node)
                is PartiqlPhysical.Type.SexpType -> transformTypeSexpType(node)
                is PartiqlPhysical.Type.BagType -> transformTypeBagType(node)
                is PartiqlPhysical.Type.AnyType -> transformTypeAnyType(node)
                is PartiqlPhysical.Type.CustomType -> transformTypeCustomType(node)
            }
        // Variant TypeNullType
        open fun transformTypeNullType(node: PartiqlPhysical.Type.NullType): PartiqlPhysical.Type {
            val new_metas = transformTypeNullType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.NullType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeNullType_metas(node: PartiqlPhysical.Type.NullType) =
            transformMetas(node.metas)
    
        // Variant TypeBooleanType
        open fun transformTypeBooleanType(node: PartiqlPhysical.Type.BooleanType): PartiqlPhysical.Type {
            val new_metas = transformTypeBooleanType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.BooleanType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeBooleanType_metas(node: PartiqlPhysical.Type.BooleanType) =
            transformMetas(node.metas)
    
        // Variant TypeSmallintType
        open fun transformTypeSmallintType(node: PartiqlPhysical.Type.SmallintType): PartiqlPhysical.Type {
            val new_metas = transformTypeSmallintType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.SmallintType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeSmallintType_metas(node: PartiqlPhysical.Type.SmallintType) =
            transformMetas(node.metas)
    
        // Variant TypeInteger4Type
        open fun transformTypeInteger4Type(node: PartiqlPhysical.Type.Integer4Type): PartiqlPhysical.Type {
            val new_metas = transformTypeInteger4Type_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.Integer4Type(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeInteger4Type_metas(node: PartiqlPhysical.Type.Integer4Type) =
            transformMetas(node.metas)
    
        // Variant TypeInteger8Type
        open fun transformTypeInteger8Type(node: PartiqlPhysical.Type.Integer8Type): PartiqlPhysical.Type {
            val new_metas = transformTypeInteger8Type_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.Integer8Type(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeInteger8Type_metas(node: PartiqlPhysical.Type.Integer8Type) =
            transformMetas(node.metas)
    
        // Variant TypeIntegerType
        open fun transformTypeIntegerType(node: PartiqlPhysical.Type.IntegerType): PartiqlPhysical.Type {
            val new_metas = transformTypeIntegerType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.IntegerType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeIntegerType_metas(node: PartiqlPhysical.Type.IntegerType) =
            transformMetas(node.metas)
    
        // Variant TypeFloatType
        open fun transformTypeFloatType(node: PartiqlPhysical.Type.FloatType): PartiqlPhysical.Type {
            val new_precision = transformTypeFloatType_precision(node)
            val new_metas = transformTypeFloatType_metas(node)
            return if (
                node.precision !== new_precision ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.FloatType(
                    precision = new_precision,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeFloatType_precision(node: PartiqlPhysical.Type.FloatType) =
            node.precision?.let { transformLongPrimitive(it) }
        open fun transformTypeFloatType_metas(node: PartiqlPhysical.Type.FloatType) =
            transformMetas(node.metas)
    
        // Variant TypeRealType
        open fun transformTypeRealType(node: PartiqlPhysical.Type.RealType): PartiqlPhysical.Type {
            val new_metas = transformTypeRealType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.RealType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeRealType_metas(node: PartiqlPhysical.Type.RealType) =
            transformMetas(node.metas)
    
        // Variant TypeDoublePrecisionType
        open fun transformTypeDoublePrecisionType(node: PartiqlPhysical.Type.DoublePrecisionType): PartiqlPhysical.Type {
            val new_metas = transformTypeDoublePrecisionType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.DoublePrecisionType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeDoublePrecisionType_metas(node: PartiqlPhysical.Type.DoublePrecisionType) =
            transformMetas(node.metas)
    
        // Variant TypeDecimalType
        open fun transformTypeDecimalType(node: PartiqlPhysical.Type.DecimalType): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Type.DecimalType(
                    precision = new_precision,
                    scale = new_scale,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeDecimalType_precision(node: PartiqlPhysical.Type.DecimalType) =
            node.precision?.let { transformLongPrimitive(it) }
        open fun transformTypeDecimalType_scale(node: PartiqlPhysical.Type.DecimalType) =
            node.scale?.let { transformLongPrimitive(it) }
        open fun transformTypeDecimalType_metas(node: PartiqlPhysical.Type.DecimalType) =
            transformMetas(node.metas)
    
        // Variant TypeNumericType
        open fun transformTypeNumericType(node: PartiqlPhysical.Type.NumericType): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Type.NumericType(
                    precision = new_precision,
                    scale = new_scale,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeNumericType_precision(node: PartiqlPhysical.Type.NumericType) =
            node.precision?.let { transformLongPrimitive(it) }
        open fun transformTypeNumericType_scale(node: PartiqlPhysical.Type.NumericType) =
            node.scale?.let { transformLongPrimitive(it) }
        open fun transformTypeNumericType_metas(node: PartiqlPhysical.Type.NumericType) =
            transformMetas(node.metas)
    
        // Variant TypeTimestampType
        open fun transformTypeTimestampType(node: PartiqlPhysical.Type.TimestampType): PartiqlPhysical.Type {
            val new_metas = transformTypeTimestampType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.TimestampType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeTimestampType_metas(node: PartiqlPhysical.Type.TimestampType) =
            transformMetas(node.metas)
    
        // Variant TypeCharacterType
        open fun transformTypeCharacterType(node: PartiqlPhysical.Type.CharacterType): PartiqlPhysical.Type {
            val new_length = transformTypeCharacterType_length(node)
            val new_metas = transformTypeCharacterType_metas(node)
            return if (
                node.length !== new_length ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.CharacterType(
                    length = new_length,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeCharacterType_length(node: PartiqlPhysical.Type.CharacterType) =
            node.length?.let { transformLongPrimitive(it) }
        open fun transformTypeCharacterType_metas(node: PartiqlPhysical.Type.CharacterType) =
            transformMetas(node.metas)
    
        // Variant TypeCharacterVaryingType
        open fun transformTypeCharacterVaryingType(node: PartiqlPhysical.Type.CharacterVaryingType): PartiqlPhysical.Type {
            val new_length = transformTypeCharacterVaryingType_length(node)
            val new_metas = transformTypeCharacterVaryingType_metas(node)
            return if (
                node.length !== new_length ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.CharacterVaryingType(
                    length = new_length,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeCharacterVaryingType_length(node: PartiqlPhysical.Type.CharacterVaryingType) =
            node.length?.let { transformLongPrimitive(it) }
        open fun transformTypeCharacterVaryingType_metas(node: PartiqlPhysical.Type.CharacterVaryingType) =
            transformMetas(node.metas)
    
        // Variant TypeMissingType
        open fun transformTypeMissingType(node: PartiqlPhysical.Type.MissingType): PartiqlPhysical.Type {
            val new_metas = transformTypeMissingType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.MissingType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeMissingType_metas(node: PartiqlPhysical.Type.MissingType) =
            transformMetas(node.metas)
    
        // Variant TypeStringType
        open fun transformTypeStringType(node: PartiqlPhysical.Type.StringType): PartiqlPhysical.Type {
            val new_metas = transformTypeStringType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.StringType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeStringType_metas(node: PartiqlPhysical.Type.StringType) =
            transformMetas(node.metas)
    
        // Variant TypeSymbolType
        open fun transformTypeSymbolType(node: PartiqlPhysical.Type.SymbolType): PartiqlPhysical.Type {
            val new_metas = transformTypeSymbolType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.SymbolType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeSymbolType_metas(node: PartiqlPhysical.Type.SymbolType) =
            transformMetas(node.metas)
    
        // Variant TypeBlobType
        open fun transformTypeBlobType(node: PartiqlPhysical.Type.BlobType): PartiqlPhysical.Type {
            val new_metas = transformTypeBlobType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.BlobType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeBlobType_metas(node: PartiqlPhysical.Type.BlobType) =
            transformMetas(node.metas)
    
        // Variant TypeClobType
        open fun transformTypeClobType(node: PartiqlPhysical.Type.ClobType): PartiqlPhysical.Type {
            val new_metas = transformTypeClobType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.ClobType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeClobType_metas(node: PartiqlPhysical.Type.ClobType) =
            transformMetas(node.metas)
    
        // Variant TypeDateType
        open fun transformTypeDateType(node: PartiqlPhysical.Type.DateType): PartiqlPhysical.Type {
            val new_metas = transformTypeDateType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.DateType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeDateType_metas(node: PartiqlPhysical.Type.DateType) =
            transformMetas(node.metas)
    
        // Variant TypeTimeType
        open fun transformTypeTimeType(node: PartiqlPhysical.Type.TimeType): PartiqlPhysical.Type {
            val new_precision = transformTypeTimeType_precision(node)
            val new_metas = transformTypeTimeType_metas(node)
            return if (
                node.precision !== new_precision ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.TimeType(
                    precision = new_precision,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeTimeType_precision(node: PartiqlPhysical.Type.TimeType) =
            node.precision?.let { transformLongPrimitive(it) }
        open fun transformTypeTimeType_metas(node: PartiqlPhysical.Type.TimeType) =
            transformMetas(node.metas)
    
        // Variant TypeTimeWithTimeZoneType
        open fun transformTypeTimeWithTimeZoneType(node: PartiqlPhysical.Type.TimeWithTimeZoneType): PartiqlPhysical.Type {
            val new_precision = transformTypeTimeWithTimeZoneType_precision(node)
            val new_metas = transformTypeTimeWithTimeZoneType_metas(node)
            return if (
                node.precision !== new_precision ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.TimeWithTimeZoneType(
                    precision = new_precision,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeTimeWithTimeZoneType_precision(node: PartiqlPhysical.Type.TimeWithTimeZoneType) =
            node.precision?.let { transformLongPrimitive(it) }
        open fun transformTypeTimeWithTimeZoneType_metas(node: PartiqlPhysical.Type.TimeWithTimeZoneType) =
            transformMetas(node.metas)
    
        // Variant TypeStructType
        open fun transformTypeStructType(node: PartiqlPhysical.Type.StructType): PartiqlPhysical.Type {
            val new_metas = transformTypeStructType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.StructType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeStructType_metas(node: PartiqlPhysical.Type.StructType) =
            transformMetas(node.metas)
    
        // Variant TypeTupleType
        open fun transformTypeTupleType(node: PartiqlPhysical.Type.TupleType): PartiqlPhysical.Type {
            val new_metas = transformTypeTupleType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.TupleType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeTupleType_metas(node: PartiqlPhysical.Type.TupleType) =
            transformMetas(node.metas)
    
        // Variant TypeListType
        open fun transformTypeListType(node: PartiqlPhysical.Type.ListType): PartiqlPhysical.Type {
            val new_metas = transformTypeListType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.ListType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeListType_metas(node: PartiqlPhysical.Type.ListType) =
            transformMetas(node.metas)
    
        // Variant TypeSexpType
        open fun transformTypeSexpType(node: PartiqlPhysical.Type.SexpType): PartiqlPhysical.Type {
            val new_metas = transformTypeSexpType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.SexpType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeSexpType_metas(node: PartiqlPhysical.Type.SexpType) =
            transformMetas(node.metas)
    
        // Variant TypeBagType
        open fun transformTypeBagType(node: PartiqlPhysical.Type.BagType): PartiqlPhysical.Type {
            val new_metas = transformTypeBagType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.BagType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeBagType_metas(node: PartiqlPhysical.Type.BagType) =
            transformMetas(node.metas)
    
        // Variant TypeAnyType
        open fun transformTypeAnyType(node: PartiqlPhysical.Type.AnyType): PartiqlPhysical.Type {
            val new_metas = transformTypeAnyType_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.AnyType(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeAnyType_metas(node: PartiqlPhysical.Type.AnyType) =
            transformMetas(node.metas)
    
        // Variant TypeCustomType
        open fun transformTypeCustomType(node: PartiqlPhysical.Type.CustomType): PartiqlPhysical.Type {
            val new_name = transformTypeCustomType_name(node)
            val new_metas = transformTypeCustomType_metas(node)
            return if (
                node.name !== new_name ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Type.CustomType(
                    name = new_name,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformTypeCustomType_name(node: PartiqlPhysical.Type.CustomType) =
            transformSymbolPrimitive(node.name)
        open fun transformTypeCustomType_metas(node: PartiqlPhysical.Type.CustomType) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: StructPart
        //////////////////////////////////////
        open fun transformStructPart(node: PartiqlPhysical.StructPart): PartiqlPhysical.StructPart =
            when(node) {
                is PartiqlPhysical.StructPart.StructFields -> transformStructPartStructFields(node)
                is PartiqlPhysical.StructPart.StructField -> transformStructPartStructField(node)
            }
        // Variant StructPartStructFields
        open fun transformStructPartStructFields(node: PartiqlPhysical.StructPart.StructFields): PartiqlPhysical.StructPart {
            val new_partExpr = transformStructPartStructFields_partExpr(node)
            val new_metas = transformStructPartStructFields_metas(node)
            return if (
                node.partExpr !== new_partExpr ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.StructPart.StructFields(
                    partExpr = new_partExpr,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformStructPartStructFields_partExpr(node: PartiqlPhysical.StructPart.StructFields) =
            transformExpr(node.partExpr)
        open fun transformStructPartStructFields_metas(node: PartiqlPhysical.StructPart.StructFields) =
            transformMetas(node.metas)
    
        // Variant StructPartStructField
        open fun transformStructPartStructField(node: PartiqlPhysical.StructPart.StructField): PartiqlPhysical.StructPart {
            val new_fieldName = transformStructPartStructField_fieldName(node)
            val new_value = transformStructPartStructField_value(node)
            val new_metas = transformStructPartStructField_metas(node)
            return if (
                node.fieldName !== new_fieldName ||
                node.value !== new_value ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.StructPart.StructField(
                    fieldName = new_fieldName,
                    value = new_value,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformStructPartStructField_fieldName(node: PartiqlPhysical.StructPart.StructField) =
            transformExpr(node.fieldName)
        open fun transformStructPartStructField_value(node: PartiqlPhysical.StructPart.StructField) =
            transformExpr(node.value)
        open fun transformStructPartStructField_metas(node: PartiqlPhysical.StructPart.StructField) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: Expr
        //////////////////////////////////////
        open fun transformExpr(node: PartiqlPhysical.Expr): PartiqlPhysical.Expr =
            when(node) {
                is PartiqlPhysical.Expr.Missing -> transformExprMissing(node)
                is PartiqlPhysical.Expr.Lit -> transformExprLit(node)
                is PartiqlPhysical.Expr.Parameter -> transformExprParameter(node)
                is PartiqlPhysical.Expr.Not -> transformExprNot(node)
                is PartiqlPhysical.Expr.Pos -> transformExprPos(node)
                is PartiqlPhysical.Expr.Neg -> transformExprNeg(node)
                is PartiqlPhysical.Expr.Plus -> transformExprPlus(node)
                is PartiqlPhysical.Expr.Minus -> transformExprMinus(node)
                is PartiqlPhysical.Expr.Times -> transformExprTimes(node)
                is PartiqlPhysical.Expr.Divide -> transformExprDivide(node)
                is PartiqlPhysical.Expr.Modulo -> transformExprModulo(node)
                is PartiqlPhysical.Expr.Concat -> transformExprConcat(node)
                is PartiqlPhysical.Expr.And -> transformExprAnd(node)
                is PartiqlPhysical.Expr.Or -> transformExprOr(node)
                is PartiqlPhysical.Expr.Eq -> transformExprEq(node)
                is PartiqlPhysical.Expr.Ne -> transformExprNe(node)
                is PartiqlPhysical.Expr.Gt -> transformExprGt(node)
                is PartiqlPhysical.Expr.Gte -> transformExprGte(node)
                is PartiqlPhysical.Expr.Lt -> transformExprLt(node)
                is PartiqlPhysical.Expr.Lte -> transformExprLte(node)
                is PartiqlPhysical.Expr.Like -> transformExprLike(node)
                is PartiqlPhysical.Expr.Between -> transformExprBetween(node)
                is PartiqlPhysical.Expr.InCollection -> transformExprInCollection(node)
                is PartiqlPhysical.Expr.IsType -> transformExprIsType(node)
                is PartiqlPhysical.Expr.SimpleCase -> transformExprSimpleCase(node)
                is PartiqlPhysical.Expr.SearchedCase -> transformExprSearchedCase(node)
                is PartiqlPhysical.Expr.Bag -> transformExprBag(node)
                is PartiqlPhysical.Expr.List -> transformExprList(node)
                is PartiqlPhysical.Expr.Sexp -> transformExprSexp(node)
                is PartiqlPhysical.Expr.Date -> transformExprDate(node)
                is PartiqlPhysical.Expr.LitTime -> transformExprLitTime(node)
                is PartiqlPhysical.Expr.BagOp -> transformExprBagOp(node)
                is PartiqlPhysical.Expr.GraphMatch -> transformExprGraphMatch(node)
                is PartiqlPhysical.Expr.Path -> transformExprPath(node)
                is PartiqlPhysical.Expr.Call -> transformExprCall(node)
                is PartiqlPhysical.Expr.Cast -> transformExprCast(node)
                is PartiqlPhysical.Expr.CanCast -> transformExprCanCast(node)
                is PartiqlPhysical.Expr.CanLosslessCast -> transformExprCanLosslessCast(node)
                is PartiqlPhysical.Expr.NullIf -> transformExprNullIf(node)
                is PartiqlPhysical.Expr.Coalesce -> transformExprCoalesce(node)
                is PartiqlPhysical.Expr.BindingsToValues -> transformExprBindingsToValues(node)
                is PartiqlPhysical.Expr.Struct -> transformExprStruct(node)
                is PartiqlPhysical.Expr.Pivot -> transformExprPivot(node)
                is PartiqlPhysical.Expr.LocalId -> transformExprLocalId(node)
                is PartiqlPhysical.Expr.GlobalId -> transformExprGlobalId(node)
            }
        // Variant ExprMissing
        open fun transformExprMissing(node: PartiqlPhysical.Expr.Missing): PartiqlPhysical.Expr {
            val new_metas = transformExprMissing_metas(node)
            return if (
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Missing(
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprMissing_metas(node: PartiqlPhysical.Expr.Missing) =
            transformMetas(node.metas)
    
        // Variant ExprLit
        open fun transformExprLit(node: PartiqlPhysical.Expr.Lit): PartiqlPhysical.Expr {
            val new_value = transformExprLit_value(node)
            val new_metas = transformExprLit_metas(node)
            return if (
                node.value !== new_value ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Lit(
                    value = new_value,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprLit_value(node: PartiqlPhysical.Expr.Lit) =
            transformAnyElement(node.value)
        open fun transformExprLit_metas(node: PartiqlPhysical.Expr.Lit) =
            transformMetas(node.metas)
    
        // Variant ExprParameter
        open fun transformExprParameter(node: PartiqlPhysical.Expr.Parameter): PartiqlPhysical.Expr {
            val new_index = transformExprParameter_index(node)
            val new_metas = transformExprParameter_metas(node)
            return if (
                node.index !== new_index ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Parameter(
                    index = new_index,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprParameter_index(node: PartiqlPhysical.Expr.Parameter) =
            transformLongPrimitive(node.index)
        open fun transformExprParameter_metas(node: PartiqlPhysical.Expr.Parameter) =
            transformMetas(node.metas)
    
        // Variant ExprNot
        open fun transformExprNot(node: PartiqlPhysical.Expr.Not): PartiqlPhysical.Expr {
            val new_expr = transformExprNot_expr(node)
            val new_metas = transformExprNot_metas(node)
            return if (
                node.expr !== new_expr ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Not(
                    expr = new_expr,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprNot_expr(node: PartiqlPhysical.Expr.Not) =
            transformExpr(node.expr)
        open fun transformExprNot_metas(node: PartiqlPhysical.Expr.Not) =
            transformMetas(node.metas)
    
        // Variant ExprPos
        open fun transformExprPos(node: PartiqlPhysical.Expr.Pos): PartiqlPhysical.Expr {
            val new_expr = transformExprPos_expr(node)
            val new_metas = transformExprPos_metas(node)
            return if (
                node.expr !== new_expr ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Pos(
                    expr = new_expr,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprPos_expr(node: PartiqlPhysical.Expr.Pos) =
            transformExpr(node.expr)
        open fun transformExprPos_metas(node: PartiqlPhysical.Expr.Pos) =
            transformMetas(node.metas)
    
        // Variant ExprNeg
        open fun transformExprNeg(node: PartiqlPhysical.Expr.Neg): PartiqlPhysical.Expr {
            val new_expr = transformExprNeg_expr(node)
            val new_metas = transformExprNeg_metas(node)
            return if (
                node.expr !== new_expr ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Neg(
                    expr = new_expr,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprNeg_expr(node: PartiqlPhysical.Expr.Neg) =
            transformExpr(node.expr)
        open fun transformExprNeg_metas(node: PartiqlPhysical.Expr.Neg) =
            transformMetas(node.metas)
    
        // Variant ExprPlus
        open fun transformExprPlus(node: PartiqlPhysical.Expr.Plus): PartiqlPhysical.Expr {
            val new_operands = transformExprPlus_operands(node)
            val new_metas = transformExprPlus_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Plus(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprPlus_operands(node: PartiqlPhysical.Expr.Plus) =
            node.operands.map { transformExpr(it) }
        open fun transformExprPlus_metas(node: PartiqlPhysical.Expr.Plus) =
            transformMetas(node.metas)
    
        // Variant ExprMinus
        open fun transformExprMinus(node: PartiqlPhysical.Expr.Minus): PartiqlPhysical.Expr {
            val new_operands = transformExprMinus_operands(node)
            val new_metas = transformExprMinus_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Minus(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprMinus_operands(node: PartiqlPhysical.Expr.Minus) =
            node.operands.map { transformExpr(it) }
        open fun transformExprMinus_metas(node: PartiqlPhysical.Expr.Minus) =
            transformMetas(node.metas)
    
        // Variant ExprTimes
        open fun transformExprTimes(node: PartiqlPhysical.Expr.Times): PartiqlPhysical.Expr {
            val new_operands = transformExprTimes_operands(node)
            val new_metas = transformExprTimes_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Times(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprTimes_operands(node: PartiqlPhysical.Expr.Times) =
            node.operands.map { transformExpr(it) }
        open fun transformExprTimes_metas(node: PartiqlPhysical.Expr.Times) =
            transformMetas(node.metas)
    
        // Variant ExprDivide
        open fun transformExprDivide(node: PartiqlPhysical.Expr.Divide): PartiqlPhysical.Expr {
            val new_operands = transformExprDivide_operands(node)
            val new_metas = transformExprDivide_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Divide(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprDivide_operands(node: PartiqlPhysical.Expr.Divide) =
            node.operands.map { transformExpr(it) }
        open fun transformExprDivide_metas(node: PartiqlPhysical.Expr.Divide) =
            transformMetas(node.metas)
    
        // Variant ExprModulo
        open fun transformExprModulo(node: PartiqlPhysical.Expr.Modulo): PartiqlPhysical.Expr {
            val new_operands = transformExprModulo_operands(node)
            val new_metas = transformExprModulo_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Modulo(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprModulo_operands(node: PartiqlPhysical.Expr.Modulo) =
            node.operands.map { transformExpr(it) }
        open fun transformExprModulo_metas(node: PartiqlPhysical.Expr.Modulo) =
            transformMetas(node.metas)
    
        // Variant ExprConcat
        open fun transformExprConcat(node: PartiqlPhysical.Expr.Concat): PartiqlPhysical.Expr {
            val new_operands = transformExprConcat_operands(node)
            val new_metas = transformExprConcat_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Concat(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprConcat_operands(node: PartiqlPhysical.Expr.Concat) =
            node.operands.map { transformExpr(it) }
        open fun transformExprConcat_metas(node: PartiqlPhysical.Expr.Concat) =
            transformMetas(node.metas)
    
        // Variant ExprAnd
        open fun transformExprAnd(node: PartiqlPhysical.Expr.And): PartiqlPhysical.Expr {
            val new_operands = transformExprAnd_operands(node)
            val new_metas = transformExprAnd_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.And(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprAnd_operands(node: PartiqlPhysical.Expr.And) =
            node.operands.map { transformExpr(it) }
        open fun transformExprAnd_metas(node: PartiqlPhysical.Expr.And) =
            transformMetas(node.metas)
    
        // Variant ExprOr
        open fun transformExprOr(node: PartiqlPhysical.Expr.Or): PartiqlPhysical.Expr {
            val new_operands = transformExprOr_operands(node)
            val new_metas = transformExprOr_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Or(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprOr_operands(node: PartiqlPhysical.Expr.Or) =
            node.operands.map { transformExpr(it) }
        open fun transformExprOr_metas(node: PartiqlPhysical.Expr.Or) =
            transformMetas(node.metas)
    
        // Variant ExprEq
        open fun transformExprEq(node: PartiqlPhysical.Expr.Eq): PartiqlPhysical.Expr {
            val new_operands = transformExprEq_operands(node)
            val new_metas = transformExprEq_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Eq(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprEq_operands(node: PartiqlPhysical.Expr.Eq) =
            node.operands.map { transformExpr(it) }
        open fun transformExprEq_metas(node: PartiqlPhysical.Expr.Eq) =
            transformMetas(node.metas)
    
        // Variant ExprNe
        open fun transformExprNe(node: PartiqlPhysical.Expr.Ne): PartiqlPhysical.Expr {
            val new_operands = transformExprNe_operands(node)
            val new_metas = transformExprNe_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Ne(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprNe_operands(node: PartiqlPhysical.Expr.Ne) =
            node.operands.map { transformExpr(it) }
        open fun transformExprNe_metas(node: PartiqlPhysical.Expr.Ne) =
            transformMetas(node.metas)
    
        // Variant ExprGt
        open fun transformExprGt(node: PartiqlPhysical.Expr.Gt): PartiqlPhysical.Expr {
            val new_operands = transformExprGt_operands(node)
            val new_metas = transformExprGt_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Gt(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprGt_operands(node: PartiqlPhysical.Expr.Gt) =
            node.operands.map { transformExpr(it) }
        open fun transformExprGt_metas(node: PartiqlPhysical.Expr.Gt) =
            transformMetas(node.metas)
    
        // Variant ExprGte
        open fun transformExprGte(node: PartiqlPhysical.Expr.Gte): PartiqlPhysical.Expr {
            val new_operands = transformExprGte_operands(node)
            val new_metas = transformExprGte_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Gte(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprGte_operands(node: PartiqlPhysical.Expr.Gte) =
            node.operands.map { transformExpr(it) }
        open fun transformExprGte_metas(node: PartiqlPhysical.Expr.Gte) =
            transformMetas(node.metas)
    
        // Variant ExprLt
        open fun transformExprLt(node: PartiqlPhysical.Expr.Lt): PartiqlPhysical.Expr {
            val new_operands = transformExprLt_operands(node)
            val new_metas = transformExprLt_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Lt(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprLt_operands(node: PartiqlPhysical.Expr.Lt) =
            node.operands.map { transformExpr(it) }
        open fun transformExprLt_metas(node: PartiqlPhysical.Expr.Lt) =
            transformMetas(node.metas)
    
        // Variant ExprLte
        open fun transformExprLte(node: PartiqlPhysical.Expr.Lte): PartiqlPhysical.Expr {
            val new_operands = transformExprLte_operands(node)
            val new_metas = transformExprLte_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Lte(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprLte_operands(node: PartiqlPhysical.Expr.Lte) =
            node.operands.map { transformExpr(it) }
        open fun transformExprLte_metas(node: PartiqlPhysical.Expr.Lte) =
            transformMetas(node.metas)
    
        // Variant ExprLike
        open fun transformExprLike(node: PartiqlPhysical.Expr.Like): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.Like(
                    value = new_value,
                    pattern = new_pattern,
                    escape = new_escape,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprLike_value(node: PartiqlPhysical.Expr.Like) =
            transformExpr(node.value)
        open fun transformExprLike_pattern(node: PartiqlPhysical.Expr.Like) =
            transformExpr(node.pattern)
        open fun transformExprLike_escape(node: PartiqlPhysical.Expr.Like) =
            node.escape?.let { transformExpr(it) }
        open fun transformExprLike_metas(node: PartiqlPhysical.Expr.Like) =
            transformMetas(node.metas)
    
        // Variant ExprBetween
        open fun transformExprBetween(node: PartiqlPhysical.Expr.Between): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.Between(
                    value = new_value,
                    from = new_from,
                    to = new_to,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprBetween_value(node: PartiqlPhysical.Expr.Between) =
            transformExpr(node.value)
        open fun transformExprBetween_from(node: PartiqlPhysical.Expr.Between) =
            transformExpr(node.from)
        open fun transformExprBetween_to(node: PartiqlPhysical.Expr.Between) =
            transformExpr(node.to)
        open fun transformExprBetween_metas(node: PartiqlPhysical.Expr.Between) =
            transformMetas(node.metas)
    
        // Variant ExprInCollection
        open fun transformExprInCollection(node: PartiqlPhysical.Expr.InCollection): PartiqlPhysical.Expr {
            val new_operands = transformExprInCollection_operands(node)
            val new_metas = transformExprInCollection_metas(node)
            return if (
                node.operands !== new_operands ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.InCollection(
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprInCollection_operands(node: PartiqlPhysical.Expr.InCollection) =
            node.operands.map { transformExpr(it) }
        open fun transformExprInCollection_metas(node: PartiqlPhysical.Expr.InCollection) =
            transformMetas(node.metas)
    
        // Variant ExprIsType
        open fun transformExprIsType(node: PartiqlPhysical.Expr.IsType): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.IsType(
                    value = new_value,
                    type = new_type,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprIsType_value(node: PartiqlPhysical.Expr.IsType) =
            transformExpr(node.value)
        open fun transformExprIsType_type(node: PartiqlPhysical.Expr.IsType) =
            transformType(node.type)
        open fun transformExprIsType_metas(node: PartiqlPhysical.Expr.IsType) =
            transformMetas(node.metas)
    
        // Variant ExprSimpleCase
        open fun transformExprSimpleCase(node: PartiqlPhysical.Expr.SimpleCase): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.SimpleCase(
                    expr = new_expr,
                    cases = new_cases,
                    default = new_default,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprSimpleCase_expr(node: PartiqlPhysical.Expr.SimpleCase) =
            transformExpr(node.expr)
        open fun transformExprSimpleCase_cases(node: PartiqlPhysical.Expr.SimpleCase) =
            transformExprPairList(node.cases)
        open fun transformExprSimpleCase_default(node: PartiqlPhysical.Expr.SimpleCase) =
            node.default?.let { transformExpr(it) }
        open fun transformExprSimpleCase_metas(node: PartiqlPhysical.Expr.SimpleCase) =
            transformMetas(node.metas)
    
        // Variant ExprSearchedCase
        open fun transformExprSearchedCase(node: PartiqlPhysical.Expr.SearchedCase): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.SearchedCase(
                    cases = new_cases,
                    default = new_default,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprSearchedCase_cases(node: PartiqlPhysical.Expr.SearchedCase) =
            transformExprPairList(node.cases)
        open fun transformExprSearchedCase_default(node: PartiqlPhysical.Expr.SearchedCase) =
            node.default?.let { transformExpr(it) }
        open fun transformExprSearchedCase_metas(node: PartiqlPhysical.Expr.SearchedCase) =
            transformMetas(node.metas)
    
        // Variant ExprBag
        open fun transformExprBag(node: PartiqlPhysical.Expr.Bag): PartiqlPhysical.Expr {
            val new_values = transformExprBag_values(node)
            val new_metas = transformExprBag_metas(node)
            return if (
                node.values !== new_values ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Bag(
                    values = new_values,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprBag_values(node: PartiqlPhysical.Expr.Bag) =
            node.values.map { transformExpr(it) }
        open fun transformExprBag_metas(node: PartiqlPhysical.Expr.Bag) =
            transformMetas(node.metas)
    
        // Variant ExprList
        open fun transformExprList(node: PartiqlPhysical.Expr.List): PartiqlPhysical.Expr {
            val new_values = transformExprList_values(node)
            val new_metas = transformExprList_metas(node)
            return if (
                node.values !== new_values ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.List(
                    values = new_values,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprList_values(node: PartiqlPhysical.Expr.List) =
            node.values.map { transformExpr(it) }
        open fun transformExprList_metas(node: PartiqlPhysical.Expr.List) =
            transformMetas(node.metas)
    
        // Variant ExprSexp
        open fun transformExprSexp(node: PartiqlPhysical.Expr.Sexp): PartiqlPhysical.Expr {
            val new_values = transformExprSexp_values(node)
            val new_metas = transformExprSexp_metas(node)
            return if (
                node.values !== new_values ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Sexp(
                    values = new_values,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprSexp_values(node: PartiqlPhysical.Expr.Sexp) =
            node.values.map { transformExpr(it) }
        open fun transformExprSexp_metas(node: PartiqlPhysical.Expr.Sexp) =
            transformMetas(node.metas)
    
        // Variant ExprDate
        open fun transformExprDate(node: PartiqlPhysical.Expr.Date): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.Date(
                    year = new_year,
                    month = new_month,
                    day = new_day,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprDate_year(node: PartiqlPhysical.Expr.Date) =
            transformLongPrimitive(node.year)
        open fun transformExprDate_month(node: PartiqlPhysical.Expr.Date) =
            transformLongPrimitive(node.month)
        open fun transformExprDate_day(node: PartiqlPhysical.Expr.Date) =
            transformLongPrimitive(node.day)
        open fun transformExprDate_metas(node: PartiqlPhysical.Expr.Date) =
            transformMetas(node.metas)
    
        // Variant ExprLitTime
        open fun transformExprLitTime(node: PartiqlPhysical.Expr.LitTime): PartiqlPhysical.Expr {
            val new_value = transformExprLitTime_value(node)
            val new_metas = transformExprLitTime_metas(node)
            return if (
                node.value !== new_value ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.LitTime(
                    value = new_value,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprLitTime_value(node: PartiqlPhysical.Expr.LitTime) =
            transformTimeValue(node.value)
        open fun transformExprLitTime_metas(node: PartiqlPhysical.Expr.LitTime) =
            transformMetas(node.metas)
    
        // Variant ExprBagOp
        open fun transformExprBagOp(node: PartiqlPhysical.Expr.BagOp): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.BagOp(
                    op = new_op,
                    quantifier = new_quantifier,
                    operands = new_operands,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprBagOp_op(node: PartiqlPhysical.Expr.BagOp) =
            transformBagOpType(node.op)
        open fun transformExprBagOp_quantifier(node: PartiqlPhysical.Expr.BagOp) =
            transformSetQuantifier(node.quantifier)
        open fun transformExprBagOp_operands(node: PartiqlPhysical.Expr.BagOp) =
            node.operands.map { transformExpr(it) }
        open fun transformExprBagOp_metas(node: PartiqlPhysical.Expr.BagOp) =
            transformMetas(node.metas)
    
        // Variant ExprGraphMatch
        open fun transformExprGraphMatch(node: PartiqlPhysical.Expr.GraphMatch): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.GraphMatch(
                    expr = new_expr,
                    gpmlPattern = new_gpmlPattern,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprGraphMatch_expr(node: PartiqlPhysical.Expr.GraphMatch) =
            transformExpr(node.expr)
        open fun transformExprGraphMatch_gpmlPattern(node: PartiqlPhysical.Expr.GraphMatch) =
            transformGpmlPattern(node.gpmlPattern)
        open fun transformExprGraphMatch_metas(node: PartiqlPhysical.Expr.GraphMatch) =
            transformMetas(node.metas)
    
        // Variant ExprPath
        open fun transformExprPath(node: PartiqlPhysical.Expr.Path): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.Path(
                    root = new_root,
                    steps = new_steps,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprPath_root(node: PartiqlPhysical.Expr.Path) =
            transformExpr(node.root)
        open fun transformExprPath_steps(node: PartiqlPhysical.Expr.Path) =
            node.steps.map { transformPathStep(it) }
        open fun transformExprPath_metas(node: PartiqlPhysical.Expr.Path) =
            transformMetas(node.metas)
    
        // Variant ExprCall
        open fun transformExprCall(node: PartiqlPhysical.Expr.Call): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.Call(
                    funcName = new_funcName,
                    args = new_args,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprCall_funcName(node: PartiqlPhysical.Expr.Call) =
            transformSymbolPrimitive(node.funcName)
        open fun transformExprCall_args(node: PartiqlPhysical.Expr.Call) =
            node.args.map { transformExpr(it) }
        open fun transformExprCall_metas(node: PartiqlPhysical.Expr.Call) =
            transformMetas(node.metas)
    
        // Variant ExprCast
        open fun transformExprCast(node: PartiqlPhysical.Expr.Cast): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.Cast(
                    value = new_value,
                    asType = new_asType,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprCast_value(node: PartiqlPhysical.Expr.Cast) =
            transformExpr(node.value)
        open fun transformExprCast_asType(node: PartiqlPhysical.Expr.Cast) =
            transformType(node.asType)
        open fun transformExprCast_metas(node: PartiqlPhysical.Expr.Cast) =
            transformMetas(node.metas)
    
        // Variant ExprCanCast
        open fun transformExprCanCast(node: PartiqlPhysical.Expr.CanCast): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.CanCast(
                    value = new_value,
                    asType = new_asType,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprCanCast_value(node: PartiqlPhysical.Expr.CanCast) =
            transformExpr(node.value)
        open fun transformExprCanCast_asType(node: PartiqlPhysical.Expr.CanCast) =
            transformType(node.asType)
        open fun transformExprCanCast_metas(node: PartiqlPhysical.Expr.CanCast) =
            transformMetas(node.metas)
    
        // Variant ExprCanLosslessCast
        open fun transformExprCanLosslessCast(node: PartiqlPhysical.Expr.CanLosslessCast): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.CanLosslessCast(
                    value = new_value,
                    asType = new_asType,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprCanLosslessCast_value(node: PartiqlPhysical.Expr.CanLosslessCast) =
            transformExpr(node.value)
        open fun transformExprCanLosslessCast_asType(node: PartiqlPhysical.Expr.CanLosslessCast) =
            transformType(node.asType)
        open fun transformExprCanLosslessCast_metas(node: PartiqlPhysical.Expr.CanLosslessCast) =
            transformMetas(node.metas)
    
        // Variant ExprNullIf
        open fun transformExprNullIf(node: PartiqlPhysical.Expr.NullIf): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Expr.NullIf(
                    expr1 = new_expr1,
                    expr2 = new_expr2,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprNullIf_expr1(node: PartiqlPhysical.Expr.NullIf) =
            transformExpr(node.expr1)
        open fun transformExprNullIf_expr2(node: PartiqlPhysical.Expr.NullIf) =
            transformExpr(node.expr2)
        open fun transformExprNullIf_metas(node: PartiqlPhysical.Expr.NullIf) =
            transformMetas(node.metas)
    
        // Variant ExprCoalesce
        open fun transformExprCoalesce(node: PartiqlPhysical.Expr.Coalesce): PartiqlPhysical.Expr {
            val new_args = transformExprCoalesce_args(node)
            val new_metas = transformExprCoalesce_metas(node)
            return if (
                node.args !== new_args ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Coalesce(
                    args = new_args,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprCoalesce_args(node: PartiqlPhysical.Expr.Coalesce) =
            node.args.map { transformExpr(it) }
        open fun transformExprCoalesce_metas(node: PartiqlPhysical.Expr.Coalesce) =
            transformMetas(node.metas)
    
        // Variant ExprBindingsToValues
        open fun transformExprBindingsToValues(node: PartiqlPhysical.Expr.BindingsToValues): PartiqlPhysical.Expr {
            val new_exp = transformExprBindingsToValues_exp(node)
            val new_query = transformExprBindingsToValues_query(node)
            val new_metas = transformExprBindingsToValues_metas(node)
            return if (
                node.exp !== new_exp ||
                node.query !== new_query ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.BindingsToValues(
                    exp = new_exp,
                    query = new_query,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprBindingsToValues_exp(node: PartiqlPhysical.Expr.BindingsToValues) =
            transformExpr(node.exp)
        open fun transformExprBindingsToValues_query(node: PartiqlPhysical.Expr.BindingsToValues) =
            transformBexpr(node.query)
        open fun transformExprBindingsToValues_metas(node: PartiqlPhysical.Expr.BindingsToValues) =
            transformMetas(node.metas)
    
        // Variant ExprStruct
        open fun transformExprStruct(node: PartiqlPhysical.Expr.Struct): PartiqlPhysical.Expr {
            val new_parts = transformExprStruct_parts(node)
            val new_metas = transformExprStruct_metas(node)
            return if (
                node.parts !== new_parts ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Struct(
                    parts = new_parts,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprStruct_parts(node: PartiqlPhysical.Expr.Struct) =
            node.parts.map { transformStructPart(it) }
        open fun transformExprStruct_metas(node: PartiqlPhysical.Expr.Struct) =
            transformMetas(node.metas)
    
        // Variant ExprPivot
        open fun transformExprPivot(node: PartiqlPhysical.Expr.Pivot): PartiqlPhysical.Expr {
            val new_input = transformExprPivot_input(node)
            val new_key = transformExprPivot_key(node)
            val new_value = transformExprPivot_value(node)
            val new_metas = transformExprPivot_metas(node)
            return if (
                node.input !== new_input ||
                node.key !== new_key ||
                node.value !== new_value ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.Pivot(
                    input = new_input,
                    key = new_key,
                    value = new_value,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprPivot_input(node: PartiqlPhysical.Expr.Pivot) =
            transformBexpr(node.input)
        open fun transformExprPivot_key(node: PartiqlPhysical.Expr.Pivot) =
            transformExpr(node.key)
        open fun transformExprPivot_value(node: PartiqlPhysical.Expr.Pivot) =
            transformExpr(node.value)
        open fun transformExprPivot_metas(node: PartiqlPhysical.Expr.Pivot) =
            transformMetas(node.metas)
    
        // Variant ExprLocalId
        open fun transformExprLocalId(node: PartiqlPhysical.Expr.LocalId): PartiqlPhysical.Expr {
            val new_index = transformExprLocalId_index(node)
            val new_metas = transformExprLocalId_metas(node)
            return if (
                node.index !== new_index ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.LocalId(
                    index = new_index,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprLocalId_index(node: PartiqlPhysical.Expr.LocalId) =
            transformLongPrimitive(node.index)
        open fun transformExprLocalId_metas(node: PartiqlPhysical.Expr.LocalId) =
            transformMetas(node.metas)
    
        // Variant ExprGlobalId
        open fun transformExprGlobalId(node: PartiqlPhysical.Expr.GlobalId): PartiqlPhysical.Expr {
            val new_uniqueId = transformExprGlobalId_uniqueId(node)
            val new_metas = transformExprGlobalId_metas(node)
            return if (
                node.uniqueId !== new_uniqueId ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Expr.GlobalId(
                    uniqueId = new_uniqueId,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformExprGlobalId_uniqueId(node: PartiqlPhysical.Expr.GlobalId) =
            transformSymbolPrimitive(node.uniqueId)
        open fun transformExprGlobalId_metas(node: PartiqlPhysical.Expr.GlobalId) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: Statement
        //////////////////////////////////////
        open fun transformStatement(node: PartiqlPhysical.Statement): PartiqlPhysical.Statement =
            when(node) {
                is PartiqlPhysical.Statement.Query -> transformStatementQuery(node)
                is PartiqlPhysical.Statement.Exec -> transformStatementExec(node)
                is PartiqlPhysical.Statement.Explain -> transformStatementExplain(node)
                is PartiqlPhysical.Statement.DmlQuery -> transformStatementDmlQuery(node)
            }
        // Variant StatementQuery
        open fun transformStatementQuery(node: PartiqlPhysical.Statement.Query): PartiqlPhysical.Statement {
            val new_expr = transformStatementQuery_expr(node)
            val new_metas = transformStatementQuery_metas(node)
            return if (
                node.expr !== new_expr ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Statement.Query(
                    expr = new_expr,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformStatementQuery_expr(node: PartiqlPhysical.Statement.Query) =
            transformExpr(node.expr)
        open fun transformStatementQuery_metas(node: PartiqlPhysical.Statement.Query) =
            transformMetas(node.metas)
    
        // Variant StatementExec
        open fun transformStatementExec(node: PartiqlPhysical.Statement.Exec): PartiqlPhysical.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
            ) {
                PartiqlPhysical.Statement.Exec(
                    procedureName = new_procedureName,
                    args = new_args,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformStatementExec_procedureName(node: PartiqlPhysical.Statement.Exec) =
            transformSymbolPrimitive(node.procedureName)
        open fun transformStatementExec_args(node: PartiqlPhysical.Statement.Exec) =
            node.args.map { transformExpr(it) }
        open fun transformStatementExec_metas(node: PartiqlPhysical.Statement.Exec) =
            transformMetas(node.metas)
    
        // Variant StatementExplain
        open fun transformStatementExplain(node: PartiqlPhysical.Statement.Explain): PartiqlPhysical.Statement {
            val new_target = transformStatementExplain_target(node)
            val new_metas = transformStatementExplain_metas(node)
            return if (
                node.target !== new_target ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Statement.Explain(
                    target = new_target,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformStatementExplain_target(node: PartiqlPhysical.Statement.Explain) =
            transformExplainTarget(node.target)
        open fun transformStatementExplain_metas(node: PartiqlPhysical.Statement.Explain) =
            transformMetas(node.metas)
    
        // Variant StatementDmlQuery
        open fun transformStatementDmlQuery(node: PartiqlPhysical.Statement.DmlQuery): PartiqlPhysical.Statement {
            val new_expr = transformStatementDmlQuery_expr(node)
            val new_metas = transformStatementDmlQuery_metas(node)
            return if (
                node.expr !== new_expr ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Statement.DmlQuery(
                    expr = new_expr,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformStatementDmlQuery_expr(node: PartiqlPhysical.Statement.DmlQuery) =
            transformExpr(node.expr)
        open fun transformStatementDmlQuery_metas(node: PartiqlPhysical.Statement.DmlQuery) =
            transformMetas(node.metas)
    
        //////////////////////////////////////
        // Sum Type: Bexpr
        //////////////////////////////////////
        open fun transformBexpr(node: PartiqlPhysical.Bexpr): PartiqlPhysical.Bexpr =
            when(node) {
                is PartiqlPhysical.Bexpr.Project -> transformBexprProject(node)
                is PartiqlPhysical.Bexpr.Scan -> transformBexprScan(node)
                is PartiqlPhysical.Bexpr.Unpivot -> transformBexprUnpivot(node)
                is PartiqlPhysical.Bexpr.Filter -> transformBexprFilter(node)
                is PartiqlPhysical.Bexpr.Join -> transformBexprJoin(node)
                is PartiqlPhysical.Bexpr.Sort -> transformBexprSort(node)
                is PartiqlPhysical.Bexpr.Aggregate -> transformBexprAggregate(node)
                is PartiqlPhysical.Bexpr.Offset -> transformBexprOffset(node)
                is PartiqlPhysical.Bexpr.Limit -> transformBexprLimit(node)
                is PartiqlPhysical.Bexpr.Let -> transformBexprLet(node)
                is PartiqlPhysical.Bexpr.Window -> transformBexprWindow(node)
            }
        // Variant BexprProject
        open fun transformBexprProject(node: PartiqlPhysical.Bexpr.Project): PartiqlPhysical.Bexpr {
            val new_i = transformBexprProject_i(node)
            val new_binding = transformBexprProject_binding(node)
            val new_args = transformBexprProject_args(node)
            val new_metas = transformBexprProject_metas(node)
            return if (
                node.i !== new_i ||
                node.binding !== new_binding ||
                node.args !== new_args ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Bexpr.Project(
                    i = new_i,
                    binding = new_binding,
                    args = new_args,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBexprProject_i(node: PartiqlPhysical.Bexpr.Project) =
            transformImpl(node.i)
        open fun transformBexprProject_binding(node: PartiqlPhysical.Bexpr.Project) =
            transformVarDecl(node.binding)
        open fun transformBexprProject_args(node: PartiqlPhysical.Bexpr.Project) =
            node.args.map { transformExpr(it) }
        open fun transformBexprProject_metas(node: PartiqlPhysical.Bexpr.Project) =
            transformMetas(node.metas)
    
        // Variant BexprScan
        open fun transformBexprScan(node: PartiqlPhysical.Bexpr.Scan): PartiqlPhysical.Bexpr {
            val new_i = transformBexprScan_i(node)
            val new_expr = transformBexprScan_expr(node)
            val new_asDecl = transformBexprScan_asDecl(node)
            val new_atDecl = transformBexprScan_atDecl(node)
            val new_byDecl = transformBexprScan_byDecl(node)
            val new_metas = transformBexprScan_metas(node)
            return if (
                node.i !== new_i ||
                node.expr !== new_expr ||
                node.asDecl !== new_asDecl ||
                node.atDecl !== new_atDecl ||
                node.byDecl !== new_byDecl ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Bexpr.Scan(
                    i = new_i,
                    expr = new_expr,
                    asDecl = new_asDecl,
                    atDecl = new_atDecl,
                    byDecl = new_byDecl,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBexprScan_i(node: PartiqlPhysical.Bexpr.Scan) =
            transformImpl(node.i)
        open fun transformBexprScan_expr(node: PartiqlPhysical.Bexpr.Scan) =
            transformExpr(node.expr)
        open fun transformBexprScan_asDecl(node: PartiqlPhysical.Bexpr.Scan) =
            transformVarDecl(node.asDecl)
        open fun transformBexprScan_atDecl(node: PartiqlPhysical.Bexpr.Scan) =
            node.atDecl?.let { transformVarDecl(it) }
        open fun transformBexprScan_byDecl(node: PartiqlPhysical.Bexpr.Scan) =
            node.byDecl?.let { transformVarDecl(it) }
        open fun transformBexprScan_metas(node: PartiqlPhysical.Bexpr.Scan) =
            transformMetas(node.metas)
    
        // Variant BexprUnpivot
        open fun transformBexprUnpivot(node: PartiqlPhysical.Bexpr.Unpivot): PartiqlPhysical.Bexpr {
            val new_i = transformBexprUnpivot_i(node)
            val new_expr = transformBexprUnpivot_expr(node)
            val new_asDecl = transformBexprUnpivot_asDecl(node)
            val new_atDecl = transformBexprUnpivot_atDecl(node)
            val new_byDecl = transformBexprUnpivot_byDecl(node)
            val new_metas = transformBexprUnpivot_metas(node)
            return if (
                node.i !== new_i ||
                node.expr !== new_expr ||
                node.asDecl !== new_asDecl ||
                node.atDecl !== new_atDecl ||
                node.byDecl !== new_byDecl ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Bexpr.Unpivot(
                    i = new_i,
                    expr = new_expr,
                    asDecl = new_asDecl,
                    atDecl = new_atDecl,
                    byDecl = new_byDecl,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBexprUnpivot_i(node: PartiqlPhysical.Bexpr.Unpivot) =
            transformImpl(node.i)
        open fun transformBexprUnpivot_expr(node: PartiqlPhysical.Bexpr.Unpivot) =
            transformExpr(node.expr)
        open fun transformBexprUnpivot_asDecl(node: PartiqlPhysical.Bexpr.Unpivot) =
            transformVarDecl(node.asDecl)
        open fun transformBexprUnpivot_atDecl(node: PartiqlPhysical.Bexpr.Unpivot) =
            node.atDecl?.let { transformVarDecl(it) }
        open fun transformBexprUnpivot_byDecl(node: PartiqlPhysical.Bexpr.Unpivot) =
            node.byDecl?.let { transformVarDecl(it) }
        open fun transformBexprUnpivot_metas(node: PartiqlPhysical.Bexpr.Unpivot) =
            transformMetas(node.metas)
    
        // Variant BexprFilter
        open fun transformBexprFilter(node: PartiqlPhysical.Bexpr.Filter): PartiqlPhysical.Bexpr {
            val new_i = transformBexprFilter_i(node)
            val new_predicate = transformBexprFilter_predicate(node)
            val new_source = transformBexprFilter_source(node)
            val new_metas = transformBexprFilter_metas(node)
            return if (
                node.i !== new_i ||
                node.predicate !== new_predicate ||
                node.source !== new_source ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Bexpr.Filter(
                    i = new_i,
                    predicate = new_predicate,
                    source = new_source,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBexprFilter_i(node: PartiqlPhysical.Bexpr.Filter) =
            transformImpl(node.i)
        open fun transformBexprFilter_predicate(node: PartiqlPhysical.Bexpr.Filter) =
            transformExpr(node.predicate)
        open fun transformBexprFilter_source(node: PartiqlPhysical.Bexpr.Filter) =
            transformBexpr(node.source)
        open fun transformBexprFilter_metas(node: PartiqlPhysical.Bexpr.Filter) =
            transformMetas(node.metas)
    
        // Variant BexprJoin
        open fun transformBexprJoin(node: PartiqlPhysical.Bexpr.Join): PartiqlPhysical.Bexpr {
            val new_i = transformBexprJoin_i(node)
            val new_joinType = transformBexprJoin_joinType(node)
            val new_left = transformBexprJoin_left(node)
            val new_right = transformBexprJoin_right(node)
            val new_predicate = transformBexprJoin_predicate(node)
            val new_metas = transformBexprJoin_metas(node)
            return if (
                node.i !== new_i ||
                node.joinType !== new_joinType ||
                node.left !== new_left ||
                node.right !== new_right ||
                node.predicate !== new_predicate ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Bexpr.Join(
                    i = new_i,
                    joinType = new_joinType,
                    left = new_left,
                    right = new_right,
                    predicate = new_predicate,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBexprJoin_i(node: PartiqlPhysical.Bexpr.Join) =
            transformImpl(node.i)
        open fun transformBexprJoin_joinType(node: PartiqlPhysical.Bexpr.Join) =
            transformJoinType(node.joinType)
        open fun transformBexprJoin_left(node: PartiqlPhysical.Bexpr.Join) =
            transformBexpr(node.left)
        open fun transformBexprJoin_right(node: PartiqlPhysical.Bexpr.Join) =
            transformBexpr(node.right)
        open fun transformBexprJoin_predicate(node: PartiqlPhysical.Bexpr.Join) =
            node.predicate?.let { transformExpr(it) }
        open fun transformBexprJoin_metas(node: PartiqlPhysical.Bexpr.Join) =
            transformMetas(node.metas)
    
        // Variant BexprSort
        open fun transformBexprSort(node: PartiqlPhysical.Bexpr.Sort): PartiqlPhysical.Bexpr {
            val new_i = transformBexprSort_i(node)
            val new_source = transformBexprSort_source(node)
            val new_sortSpecs = transformBexprSort_sortSpecs(node)
            val new_metas = transformBexprSort_metas(node)
            return if (
                node.i !== new_i ||
                node.source !== new_source ||
                node.sortSpecs !== new_sortSpecs ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Bexpr.Sort(
                    i = new_i,
                    source = new_source,
                    sortSpecs = new_sortSpecs,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBexprSort_i(node: PartiqlPhysical.Bexpr.Sort) =
            transformImpl(node.i)
        open fun transformBexprSort_source(node: PartiqlPhysical.Bexpr.Sort) =
            transformBexpr(node.source)
        open fun transformBexprSort_sortSpecs(node: PartiqlPhysical.Bexpr.Sort) =
            node.sortSpecs.map { transformSortSpec(it) }
        open fun transformBexprSort_metas(node: PartiqlPhysical.Bexpr.Sort) =
            transformMetas(node.metas)
    
        // Variant BexprAggregate
        open fun transformBexprAggregate(node: PartiqlPhysical.Bexpr.Aggregate): PartiqlPhysical.Bexpr {
            val new_i = transformBexprAggregate_i(node)
            val new_source = transformBexprAggregate_source(node)
            val new_strategy = transformBexprAggregate_strategy(node)
            val new_groupList = transformBexprAggregate_groupList(node)
            val new_functionList = transformBexprAggregate_functionList(node)
            val new_metas = transformBexprAggregate_metas(node)
            return if (
                node.i !== new_i ||
                node.source !== new_source ||
                node.strategy !== new_strategy ||
                node.groupList !== new_groupList ||
                node.functionList !== new_functionList ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Bexpr.Aggregate(
                    i = new_i,
                    source = new_source,
                    strategy = new_strategy,
                    groupList = new_groupList,
                    functionList = new_functionList,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBexprAggregate_i(node: PartiqlPhysical.Bexpr.Aggregate) =
            transformImpl(node.i)
        open fun transformBexprAggregate_source(node: PartiqlPhysical.Bexpr.Aggregate) =
            transformBexpr(node.source)
        open fun transformBexprAggregate_strategy(node: PartiqlPhysical.Bexpr.Aggregate) =
            transformGroupingStrategy(node.strategy)
        open fun transformBexprAggregate_groupList(node: PartiqlPhysical.Bexpr.Aggregate) =
            transformGroupKeyList(node.groupList)
        open fun transformBexprAggregate_functionList(node: PartiqlPhysical.Bexpr.Aggregate) =
            transformAggregateFunctionList(node.functionList)
        open fun transformBexprAggregate_metas(node: PartiqlPhysical.Bexpr.Aggregate) =
            transformMetas(node.metas)
    
        // Variant BexprOffset
        open fun transformBexprOffset(node: PartiqlPhysical.Bexpr.Offset): PartiqlPhysical.Bexpr {
            val new_i = transformBexprOffset_i(node)
            val new_rowCount = transformBexprOffset_rowCount(node)
            val new_source = transformBexprOffset_source(node)
            val new_metas = transformBexprOffset_metas(node)
            return if (
                node.i !== new_i ||
                node.rowCount !== new_rowCount ||
                node.source !== new_source ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Bexpr.Offset(
                    i = new_i,
                    rowCount = new_rowCount,
                    source = new_source,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBexprOffset_i(node: PartiqlPhysical.Bexpr.Offset) =
            transformImpl(node.i)
        open fun transformBexprOffset_rowCount(node: PartiqlPhysical.Bexpr.Offset) =
            transformExpr(node.rowCount)
        open fun transformBexprOffset_source(node: PartiqlPhysical.Bexpr.Offset) =
            transformBexpr(node.source)
        open fun transformBexprOffset_metas(node: PartiqlPhysical.Bexpr.Offset) =
            transformMetas(node.metas)
    
        // Variant BexprLimit
        open fun transformBexprLimit(node: PartiqlPhysical.Bexpr.Limit): PartiqlPhysical.Bexpr {
            val new_i = transformBexprLimit_i(node)
            val new_rowCount = transformBexprLimit_rowCount(node)
            val new_source = transformBexprLimit_source(node)
            val new_metas = transformBexprLimit_metas(node)
            return if (
                node.i !== new_i ||
                node.rowCount !== new_rowCount ||
                node.source !== new_source ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Bexpr.Limit(
                    i = new_i,
                    rowCount = new_rowCount,
                    source = new_source,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBexprLimit_i(node: PartiqlPhysical.Bexpr.Limit) =
            transformImpl(node.i)
        open fun transformBexprLimit_rowCount(node: PartiqlPhysical.Bexpr.Limit) =
            transformExpr(node.rowCount)
        open fun transformBexprLimit_source(node: PartiqlPhysical.Bexpr.Limit) =
            transformBexpr(node.source)
        open fun transformBexprLimit_metas(node: PartiqlPhysical.Bexpr.Limit) =
            transformMetas(node.metas)
    
        // Variant BexprLet
        open fun transformBexprLet(node: PartiqlPhysical.Bexpr.Let): PartiqlPhysical.Bexpr {
            val new_i = transformBexprLet_i(node)
            val new_source = transformBexprLet_source(node)
            val new_bindings = transformBexprLet_bindings(node)
            val new_metas = transformBexprLet_metas(node)
            return if (
                node.i !== new_i ||
                node.source !== new_source ||
                node.bindings !== new_bindings ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Bexpr.Let(
                    i = new_i,
                    source = new_source,
                    bindings = new_bindings,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBexprLet_i(node: PartiqlPhysical.Bexpr.Let) =
            transformImpl(node.i)
        open fun transformBexprLet_source(node: PartiqlPhysical.Bexpr.Let) =
            transformBexpr(node.source)
        open fun transformBexprLet_bindings(node: PartiqlPhysical.Bexpr.Let) =
            node.bindings.map { transformLetBinding(it) }
        open fun transformBexprLet_metas(node: PartiqlPhysical.Bexpr.Let) =
            transformMetas(node.metas)
    
        // Variant BexprWindow
        open fun transformBexprWindow(node: PartiqlPhysical.Bexpr.Window): PartiqlPhysical.Bexpr {
            val new_i = transformBexprWindow_i(node)
            val new_source = transformBexprWindow_source(node)
            val new_windowSpecification = transformBexprWindow_windowSpecification(node)
            val new_windowExpressionList = transformBexprWindow_windowExpressionList(node)
            val new_metas = transformBexprWindow_metas(node)
            return if (
                node.i !== new_i ||
                node.source !== new_source ||
                node.windowSpecification !== new_windowSpecification ||
                node.windowExpressionList !== new_windowExpressionList ||
                node.metas !== new_metas
            ) {
                PartiqlPhysical.Bexpr.Window(
                    i = new_i,
                    source = new_source,
                    windowSpecification = new_windowSpecification,
                    windowExpressionList = new_windowExpressionList,
                    metas = new_metas
                )
            } else {
                node
            }
        }
        open fun transformBexprWindow_i(node: PartiqlPhysical.Bexpr.Window) =
            transformImpl(node.i)
        open fun transformBexprWindow_source(node: PartiqlPhysical.Bexpr.Window) =
            transformBexpr(node.source)
        open fun transformBexprWindow_windowSpecification(node: PartiqlPhysical.Bexpr.Window) =
            transformOver(node.windowSpecification)
        open fun transformBexprWindow_windowExpressionList(node: PartiqlPhysical.Bexpr.Window) =
            node.windowExpressionList.map { transformWindowExpression(it) }
        open fun transformBexprWindow_metas(node: PartiqlPhysical.Bexpr.Window) =
            transformMetas(node.metas)
    
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy