org.partiql.lang.domains.PartiqlLogical.generated.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of partiql-lang-kotlin Show documentation
Show all versions of partiql-lang-kotlin Show documentation
An implementation of PartiQL for the JVM written in Kotlin.
/**
* 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 PartiqlLogical private constructor() {
/////////////////////////////////////////////////////////////////////////////
// Builder
/////////////////////////////////////////////////////////////////////////////
companion object {
@JvmStatic
fun BUILDER() : Builder = PartiqlLogicalBuilder
fun build(block: Builder.() -> T) =
PartiqlLogicalBuilder.block()
fun transform(element: AnyElement): PartiqlLogicalNode =
transform(element.asSexp())
fun transform(element: SexpElement): PartiqlLogicalNode =
IonElementTransformer().transform(element)
}
interface Builder {
fun newMetaContainer() = emptyMetaContainer()
// Tuples
/**
* Creates an instance of [PartiqlLogical.TimeValue].
*/
fun timeValue(
hour: Long,
minute: Long,
second: Long,
nano: Long,
precision: Long,
withTimeZone: Boolean,
tzMinutes: Long? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.TimeValue =
PartiqlLogical.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 [PartiqlLogical.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()
): PartiqlLogical.TimeValue =
PartiqlLogical.TimeValue(
hour = hour,
minute = minute,
second = second,
nano = nano,
precision = precision,
withTimeZone = withTimeZone,
tzMinutes = tzMinutes,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchQuantifier].
*/
fun graphMatchQuantifier(
lower: Long,
upper: Long? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchQuantifier =
PartiqlLogical.GraphMatchQuantifier(
lower = lower.asPrimitive(),
upper = upper?.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.GraphMatchQuantifier =
PartiqlLogical.GraphMatchQuantifier(
lower = lower,
upper = upper,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchPattern].
*/
fun graphMatchPattern(
restrictor: GraphMatchRestrictor? = null,
prefilter: Expr? = null,
variable: String? = null,
quantifier: GraphMatchQuantifier? = null,
parts: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchPattern =
PartiqlLogical.GraphMatchPattern(
restrictor = restrictor,
prefilter = prefilter,
variable = variable?.asPrimitive(),
quantifier = quantifier,
parts = parts,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.GraphMatchPattern =
PartiqlLogical.GraphMatchPattern(
restrictor = restrictor,
prefilter = prefilter,
variable = variable,
quantifier = quantifier,
parts = parts,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchPattern].
*/
fun graphMatchPattern(
restrictor: GraphMatchRestrictor? = null,
prefilter: Expr? = null,
variable: String? = null,
quantifier: GraphMatchQuantifier? = null,
parts0: GraphMatchPatternPart,
vararg parts: GraphMatchPatternPart,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchPattern =
PartiqlLogical.GraphMatchPattern(
restrictor = restrictor,
prefilter = prefilter,
variable = variable?.asPrimitive(),
quantifier = quantifier,
parts = listOf(parts0) + parts.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.GraphMatchPattern =
PartiqlLogical.GraphMatchPattern(
restrictor = restrictor,
prefilter = prefilter,
variable = variable,
quantifier = quantifier,
parts = listOf(parts0) + parts.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GpmlPattern].
*/
fun gpmlPattern(
selector: GraphMatchSelector? = null,
patterns: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GpmlPattern =
PartiqlLogical.GpmlPattern(
selector = selector,
patterns = patterns,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GpmlPattern].
*/
fun gpmlPattern(
selector: GraphMatchSelector? = null,
patterns0: GraphMatchPattern,
vararg patterns: GraphMatchPattern,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GpmlPattern =
PartiqlLogical.GpmlPattern(
selector = selector,
patterns = listOf(patterns0) + patterns.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.ExprPair].
*/
fun exprPair(
first: Expr,
second: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.ExprPair =
PartiqlLogical.ExprPair(
first = first,
second = second,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.ExprPairList].
*/
fun exprPairList(
pairs: kotlin.collections.List = emptyList(),
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.ExprPairList =
PartiqlLogical.ExprPairList(
pairs = pairs,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.ExprPairList].
*/
fun exprPairList(
vararg pairs: ExprPair,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.ExprPairList =
PartiqlLogical.ExprPairList(
pairs = pairs.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.SortSpec].
*/
fun sortSpec(
expr: Expr,
orderingSpec: OrderingSpec? = null,
nullsSpec: NullsSpec? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.SortSpec =
PartiqlLogical.SortSpec(
expr = expr,
orderingSpec = orderingSpec,
nullsSpec = nullsSpec,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Over].
*/
fun over(
partitionBy: WindowPartitionList? = null,
orderBy: WindowSortSpecList? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Over =
PartiqlLogical.Over(
partitionBy = partitionBy,
orderBy = orderBy,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.WindowPartitionList].
*/
fun windowPartitionList(
exprs: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.WindowPartitionList =
PartiqlLogical.WindowPartitionList(
exprs = exprs,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.WindowPartitionList].
*/
fun windowPartitionList(
exprs0: Expr,
vararg exprs: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.WindowPartitionList =
PartiqlLogical.WindowPartitionList(
exprs = listOf(exprs0) + exprs.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.WindowSortSpecList].
*/
fun windowSortSpecList(
sortSpecs: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.WindowSortSpecList =
PartiqlLogical.WindowSortSpecList(
sortSpecs = sortSpecs,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.WindowSortSpecList].
*/
fun windowSortSpecList(
sortSpecs0: SortSpec,
vararg sortSpecs: SortSpec,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.WindowSortSpecList =
PartiqlLogical.WindowSortSpecList(
sortSpecs = listOf(sortSpecs0) + sortSpecs.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Identifier].
*/
fun identifier(
name: String,
case: CaseSensitivity,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Identifier =
PartiqlLogical.Identifier(
name = name.asPrimitive(),
case = case,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Identifier =
PartiqlLogical.Identifier(
name = name,
case = case,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Plan].
*/
fun plan(
stmt: Statement,
version: String,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Plan =
PartiqlLogical.Plan(
stmt = stmt,
version = version.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Plan =
PartiqlLogical.Plan(
stmt = stmt,
version = version,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.LetBinding].
*/
fun letBinding(
value: Expr,
decl: VarDecl,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.LetBinding =
PartiqlLogical.LetBinding(
value = value,
decl = decl,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GroupKey].
*/
fun groupKey(
expr: Expr,
asVar: VarDecl,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GroupKey =
PartiqlLogical.GroupKey(
expr = expr,
asVar = asVar,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GroupKeyList].
*/
fun groupKeyList(
keys: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GroupKeyList =
PartiqlLogical.GroupKeyList(
keys = keys,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GroupKeyList].
*/
fun groupKeyList(
keys0: GroupKey,
vararg keys: GroupKey,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GroupKeyList =
PartiqlLogical.GroupKeyList(
keys = listOf(keys0) + keys.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.AggregateFunction].
*/
fun aggregateFunction(
quantifier: SetQuantifier,
name: String,
arg: Expr,
asVar: VarDecl,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.AggregateFunction =
PartiqlLogical.AggregateFunction(
quantifier = quantifier,
name = name.asPrimitive(),
arg = arg,
asVar = asVar,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.AggregateFunction =
PartiqlLogical.AggregateFunction(
quantifier = quantifier,
name = name,
arg = arg,
asVar = asVar,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.AggregateFunctionList].
*/
fun aggregateFunctionList(
functions: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.AggregateFunctionList =
PartiqlLogical.AggregateFunctionList(
functions = functions,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.AggregateFunctionList].
*/
fun aggregateFunctionList(
functions0: AggregateFunction,
vararg functions: AggregateFunction,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.AggregateFunctionList =
PartiqlLogical.AggregateFunctionList(
functions = listOf(functions0) + functions.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.WindowExpression].
*/
fun windowExpression(
decl: VarDecl,
funcName: String,
args: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.WindowExpression =
PartiqlLogical.WindowExpression(
decl = decl,
funcName = funcName.asPrimitive(),
args = args,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.WindowExpression =
PartiqlLogical.WindowExpression(
decl = decl,
funcName = funcName,
args = args,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.WindowExpression].
*/
fun windowExpression(
decl: VarDecl,
funcName: String,
args0: Expr,
vararg args: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.WindowExpression =
PartiqlLogical.WindowExpression(
decl = decl,
funcName = funcName?.asPrimitive(),
args = listOf(args0) + args.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.WindowExpression =
PartiqlLogical.WindowExpression(
decl = decl,
funcName = funcName,
args = listOf(args0) + args.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.VarDecl].
*/
fun varDecl(
name: String,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.VarDecl =
PartiqlLogical.VarDecl(
name = name.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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_(
name: org.partiql.pig.runtime.SymbolPrimitive,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.VarDecl =
PartiqlLogical.VarDecl(
name = name,
metas = newMetaContainer() + metas
)
// Variants for Sum: ExplainTarget
/**
* Creates an instance of [PartiqlLogical.ExplainTarget.Domain].
*/
fun domain(
statement: Statement,
type: String? = null,
format: String? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.ExplainTarget.Domain =
PartiqlLogical.ExplainTarget.Domain(
statement = statement,
type = type?.asPrimitive(),
format = format?.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.ExplainTarget.Domain =
PartiqlLogical.ExplainTarget.Domain(
statement = statement,
type = type,
format = format,
metas = newMetaContainer() + metas
)
// Variants for Sum: PathStep
/**
* Creates an instance of [PartiqlLogical.PathStep.PathExpr].
*/
fun pathExpr(
index: Expr,
case: CaseSensitivity,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.PathStep.PathExpr =
PartiqlLogical.PathStep.PathExpr(
index = index,
case = case,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.PathStep.PathWildcard].
*/
fun pathWildcard(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.PathStep.PathWildcard =
PartiqlLogical.PathStep.PathWildcard(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.PathStep.PathUnpivot].
*/
fun pathUnpivot(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.PathStep.PathUnpivot =
PartiqlLogical.PathStep.PathUnpivot(
metas = newMetaContainer() + metas
)
// Variants for Sum: JoinType
/**
* Creates an instance of [PartiqlLogical.JoinType.Inner].
*/
fun inner(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.JoinType.Inner =
PartiqlLogical.JoinType.Inner(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.JoinType.Left].
*/
fun left(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.JoinType.Left =
PartiqlLogical.JoinType.Left(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.JoinType.Right].
*/
fun right(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.JoinType.Right =
PartiqlLogical.JoinType.Right(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.JoinType.Full].
*/
fun full(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.JoinType.Full =
PartiqlLogical.JoinType.Full(
metas = newMetaContainer() + metas
)
// Variants for Sum: GraphMatchDirection
/**
* Creates an instance of [PartiqlLogical.GraphMatchDirection.EdgeLeft].
*/
fun edgeLeft(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchDirection.EdgeLeft =
PartiqlLogical.GraphMatchDirection.EdgeLeft(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchDirection.EdgeUndirected].
*/
fun edgeUndirected(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchDirection.EdgeUndirected =
PartiqlLogical.GraphMatchDirection.EdgeUndirected(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchDirection.EdgeRight].
*/
fun edgeRight(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchDirection.EdgeRight =
PartiqlLogical.GraphMatchDirection.EdgeRight(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchDirection.EdgeLeftOrUndirected].
*/
fun edgeLeftOrUndirected(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchDirection.EdgeLeftOrUndirected =
PartiqlLogical.GraphMatchDirection.EdgeLeftOrUndirected(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchDirection.EdgeUndirectedOrRight].
*/
fun edgeUndirectedOrRight(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchDirection.EdgeUndirectedOrRight =
PartiqlLogical.GraphMatchDirection.EdgeUndirectedOrRight(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchDirection.EdgeLeftOrRight].
*/
fun edgeLeftOrRight(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchDirection.EdgeLeftOrRight =
PartiqlLogical.GraphMatchDirection.EdgeLeftOrRight(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight].
*/
fun edgeLeftOrUndirectedOrRight(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight =
PartiqlLogical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight(
metas = newMetaContainer() + metas
)
// Variants for Sum: GraphMatchPatternPart
/**
* Creates an instance of [PartiqlLogical.GraphMatchPatternPart.Node].
*/
fun node(
prefilter: Expr? = null,
variable: String? = null,
label: kotlin.collections.List = emptyList(),
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchPatternPart.Node =
PartiqlLogical.GraphMatchPatternPart.Node(
prefilter = prefilter,
variable = variable?.asPrimitive(),
label = label.map { it.asPrimitive() },
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.GraphMatchPatternPart.Node =
PartiqlLogical.GraphMatchPatternPart.Node(
prefilter = prefilter,
variable = variable,
label = label,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchPatternPart.Node].
*/
fun node(
prefilter: Expr? = null,
variable: String? = null,
vararg label: String,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchPatternPart.Node =
PartiqlLogical.GraphMatchPatternPart.Node(
prefilter = prefilter,
variable = variable?.asPrimitive(),
label = label.map { it.asPrimitive() },
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.GraphMatchPatternPart.Node =
PartiqlLogical.GraphMatchPatternPart.Node(
prefilter = prefilter,
variable = variable,
label = label.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchPatternPart.Edge].
*/
fun edge(
direction: GraphMatchDirection,
quantifier: GraphMatchQuantifier? = null,
prefilter: Expr? = null,
variable: String? = null,
label: kotlin.collections.List = emptyList(),
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchPatternPart.Edge =
PartiqlLogical.GraphMatchPatternPart.Edge(
direction = direction,
quantifier = quantifier,
prefilter = prefilter,
variable = variable?.asPrimitive(),
label = label.map { it.asPrimitive() },
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.GraphMatchPatternPart.Edge =
PartiqlLogical.GraphMatchPatternPart.Edge(
direction = direction,
quantifier = quantifier,
prefilter = prefilter,
variable = variable,
label = label,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchPatternPart.Edge].
*/
fun edge(
direction: GraphMatchDirection,
quantifier: GraphMatchQuantifier? = null,
prefilter: Expr? = null,
variable: String? = null,
vararg label: String,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchPatternPart.Edge =
PartiqlLogical.GraphMatchPatternPart.Edge(
direction = direction,
quantifier = quantifier,
prefilter = prefilter,
variable = variable?.asPrimitive(),
label = label.map { it.asPrimitive() },
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.GraphMatchPatternPart.Edge =
PartiqlLogical.GraphMatchPatternPart.Edge(
direction = direction,
quantifier = quantifier,
prefilter = prefilter,
variable = variable,
label = label.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchPatternPart.Pattern].
*/
fun pattern(
pattern: GraphMatchPattern,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchPatternPart.Pattern =
PartiqlLogical.GraphMatchPatternPart.Pattern(
pattern = pattern,
metas = newMetaContainer() + metas
)
// Variants for Sum: GraphMatchRestrictor
/**
* Creates an instance of [PartiqlLogical.GraphMatchRestrictor.RestrictorTrail].
*/
fun restrictorTrail(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchRestrictor.RestrictorTrail =
PartiqlLogical.GraphMatchRestrictor.RestrictorTrail(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchRestrictor.RestrictorAcyclic].
*/
fun restrictorAcyclic(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchRestrictor.RestrictorAcyclic =
PartiqlLogical.GraphMatchRestrictor.RestrictorAcyclic(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchRestrictor.RestrictorSimple].
*/
fun restrictorSimple(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchRestrictor.RestrictorSimple =
PartiqlLogical.GraphMatchRestrictor.RestrictorSimple(
metas = newMetaContainer() + metas
)
// Variants for Sum: GraphMatchSelector
/**
* Creates an instance of [PartiqlLogical.GraphMatchSelector.SelectorAnyShortest].
*/
fun selectorAnyShortest(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchSelector.SelectorAnyShortest =
PartiqlLogical.GraphMatchSelector.SelectorAnyShortest(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchSelector.SelectorAllShortest].
*/
fun selectorAllShortest(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchSelector.SelectorAllShortest =
PartiqlLogical.GraphMatchSelector.SelectorAllShortest(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchSelector.SelectorAny].
*/
fun selectorAny(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchSelector.SelectorAny =
PartiqlLogical.GraphMatchSelector.SelectorAny(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchSelector.SelectorAnyK].
*/
fun selectorAnyK(
k: Long,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchSelector.SelectorAnyK =
PartiqlLogical.GraphMatchSelector.SelectorAnyK(
k = k.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.GraphMatchSelector.SelectorAnyK =
PartiqlLogical.GraphMatchSelector.SelectorAnyK(
k = k,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchSelector.SelectorShortestK].
*/
fun selectorShortestK(
k: Long,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchSelector.SelectorShortestK =
PartiqlLogical.GraphMatchSelector.SelectorShortestK(
k = k.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.GraphMatchSelector.SelectorShortestK =
PartiqlLogical.GraphMatchSelector.SelectorShortestK(
k = k,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GraphMatchSelector.SelectorShortestKGroup].
*/
fun selectorShortestKGroup(
k: Long,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GraphMatchSelector.SelectorShortestKGroup =
PartiqlLogical.GraphMatchSelector.SelectorShortestKGroup(
k = k.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.GraphMatchSelector.SelectorShortestKGroup =
PartiqlLogical.GraphMatchSelector.SelectorShortestKGroup(
k = k,
metas = newMetaContainer() + metas
)
// Variants for Sum: GroupingStrategy
/**
* Creates an instance of [PartiqlLogical.GroupingStrategy.GroupFull].
*/
fun groupFull(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GroupingStrategy.GroupFull =
PartiqlLogical.GroupingStrategy.GroupFull(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.GroupingStrategy.GroupPartial].
*/
fun groupPartial(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.GroupingStrategy.GroupPartial =
PartiqlLogical.GroupingStrategy.GroupPartial(
metas = newMetaContainer() + metas
)
// Variants for Sum: OrderingSpec
/**
* Creates an instance of [PartiqlLogical.OrderingSpec.Asc].
*/
fun asc(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.OrderingSpec.Asc =
PartiqlLogical.OrderingSpec.Asc(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.OrderingSpec.Desc].
*/
fun desc(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.OrderingSpec.Desc =
PartiqlLogical.OrderingSpec.Desc(
metas = newMetaContainer() + metas
)
// Variants for Sum: NullsSpec
/**
* Creates an instance of [PartiqlLogical.NullsSpec.NullsFirst].
*/
fun nullsFirst(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.NullsSpec.NullsFirst =
PartiqlLogical.NullsSpec.NullsFirst(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.NullsSpec.NullsLast].
*/
fun nullsLast(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.NullsSpec.NullsLast =
PartiqlLogical.NullsSpec.NullsLast(
metas = newMetaContainer() + metas
)
// Variants for Sum: CaseSensitivity
/**
* Creates an instance of [PartiqlLogical.CaseSensitivity.CaseSensitive].
*/
fun caseSensitive(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.CaseSensitivity.CaseSensitive =
PartiqlLogical.CaseSensitivity.CaseSensitive(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.CaseSensitivity.CaseInsensitive].
*/
fun caseInsensitive(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.CaseSensitivity.CaseInsensitive =
PartiqlLogical.CaseSensitivity.CaseInsensitive(
metas = newMetaContainer() + metas
)
// Variants for Sum: ScopeQualifier
/**
* Creates an instance of [PartiqlLogical.ScopeQualifier.Unqualified].
*/
fun unqualified(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.ScopeQualifier.Unqualified =
PartiqlLogical.ScopeQualifier.Unqualified(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.ScopeQualifier.LocalsFirst].
*/
fun localsFirst(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.ScopeQualifier.LocalsFirst =
PartiqlLogical.ScopeQualifier.LocalsFirst(
metas = newMetaContainer() + metas
)
// Variants for Sum: SetQuantifier
/**
* Creates an instance of [PartiqlLogical.SetQuantifier.All].
*/
fun all(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.SetQuantifier.All =
PartiqlLogical.SetQuantifier.All(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.SetQuantifier.Distinct].
*/
fun distinct(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.SetQuantifier.Distinct =
PartiqlLogical.SetQuantifier.Distinct(
metas = newMetaContainer() + metas
)
// Variants for Sum: BagOpType
/**
* Creates an instance of [PartiqlLogical.BagOpType.Union].
*/
fun union(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.BagOpType.Union =
PartiqlLogical.BagOpType.Union(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.BagOpType.Intersect].
*/
fun intersect(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.BagOpType.Intersect =
PartiqlLogical.BagOpType.Intersect(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.BagOpType.Except].
*/
fun except(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.BagOpType.Except =
PartiqlLogical.BagOpType.Except(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.BagOpType.OuterUnion].
*/
fun outerUnion(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.BagOpType.OuterUnion =
PartiqlLogical.BagOpType.OuterUnion(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.BagOpType.OuterIntersect].
*/
fun outerIntersect(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.BagOpType.OuterIntersect =
PartiqlLogical.BagOpType.OuterIntersect(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.BagOpType.OuterExcept].
*/
fun outerExcept(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.BagOpType.OuterExcept =
PartiqlLogical.BagOpType.OuterExcept(
metas = newMetaContainer() + metas
)
// Variants for Sum: OnConflictValue
/**
* Creates an instance of [PartiqlLogical.OnConflictValue.Excluded].
*/
fun excluded(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.OnConflictValue.Excluded =
PartiqlLogical.OnConflictValue.Excluded(
metas = newMetaContainer() + metas
)
// Variants for Sum: Type
/**
* Creates an instance of [PartiqlLogical.Type.NullType].
*/
fun nullType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.NullType =
PartiqlLogical.Type.NullType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.BooleanType].
*/
fun booleanType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.BooleanType =
PartiqlLogical.Type.BooleanType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.SmallintType].
*/
fun smallintType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.SmallintType =
PartiqlLogical.Type.SmallintType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.Integer4Type].
*/
fun integer4Type(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.Integer4Type =
PartiqlLogical.Type.Integer4Type(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.Integer8Type].
*/
fun integer8Type(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.Integer8Type =
PartiqlLogical.Type.Integer8Type(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.IntegerType].
*/
fun integerType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.IntegerType =
PartiqlLogical.Type.IntegerType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.FloatType].
*/
fun floatType(
precision: Long? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.FloatType =
PartiqlLogical.Type.FloatType(
precision = precision?.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Type.FloatType =
PartiqlLogical.Type.FloatType(
precision = precision,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.RealType].
*/
fun realType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.RealType =
PartiqlLogical.Type.RealType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.DoublePrecisionType].
*/
fun doublePrecisionType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.DoublePrecisionType =
PartiqlLogical.Type.DoublePrecisionType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.DecimalType].
*/
fun decimalType(
precision: Long? = null,
scale: Long? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.DecimalType =
PartiqlLogical.Type.DecimalType(
precision = precision?.asPrimitive(),
scale = scale?.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Type.DecimalType =
PartiqlLogical.Type.DecimalType(
precision = precision,
scale = scale,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.NumericType].
*/
fun numericType(
precision: Long? = null,
scale: Long? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.NumericType =
PartiqlLogical.Type.NumericType(
precision = precision?.asPrimitive(),
scale = scale?.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Type.NumericType =
PartiqlLogical.Type.NumericType(
precision = precision,
scale = scale,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.TimestampType].
*/
fun timestampType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.TimestampType =
PartiqlLogical.Type.TimestampType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.CharacterType].
*/
fun characterType(
length: Long? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.CharacterType =
PartiqlLogical.Type.CharacterType(
length = length?.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Type.CharacterType =
PartiqlLogical.Type.CharacterType(
length = length,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.CharacterVaryingType].
*/
fun characterVaryingType(
length: Long? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.CharacterVaryingType =
PartiqlLogical.Type.CharacterVaryingType(
length = length?.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Type.CharacterVaryingType =
PartiqlLogical.Type.CharacterVaryingType(
length = length,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.MissingType].
*/
fun missingType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.MissingType =
PartiqlLogical.Type.MissingType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.StringType].
*/
fun stringType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.StringType =
PartiqlLogical.Type.StringType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.SymbolType].
*/
fun symbolType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.SymbolType =
PartiqlLogical.Type.SymbolType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.BlobType].
*/
fun blobType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.BlobType =
PartiqlLogical.Type.BlobType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.ClobType].
*/
fun clobType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.ClobType =
PartiqlLogical.Type.ClobType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.DateType].
*/
fun dateType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.DateType =
PartiqlLogical.Type.DateType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.TimeType].
*/
fun timeType(
precision: Long? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.TimeType =
PartiqlLogical.Type.TimeType(
precision = precision?.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Type.TimeType =
PartiqlLogical.Type.TimeType(
precision = precision,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.TimeWithTimeZoneType].
*/
fun timeWithTimeZoneType(
precision: Long? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.TimeWithTimeZoneType =
PartiqlLogical.Type.TimeWithTimeZoneType(
precision = precision?.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Type.TimeWithTimeZoneType =
PartiqlLogical.Type.TimeWithTimeZoneType(
precision = precision,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.StructType].
*/
fun structType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.StructType =
PartiqlLogical.Type.StructType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.TupleType].
*/
fun tupleType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.TupleType =
PartiqlLogical.Type.TupleType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.ListType].
*/
fun listType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.ListType =
PartiqlLogical.Type.ListType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.SexpType].
*/
fun sexpType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.SexpType =
PartiqlLogical.Type.SexpType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.BagType].
*/
fun bagType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.BagType =
PartiqlLogical.Type.BagType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.AnyType].
*/
fun anyType(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.AnyType =
PartiqlLogical.Type.AnyType(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Type.CustomType].
*/
fun customType(
name: String,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Type.CustomType =
PartiqlLogical.Type.CustomType(
name = name.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Type.CustomType =
PartiqlLogical.Type.CustomType(
name = name,
metas = newMetaContainer() + metas
)
// Variants for Sum: Expr
/**
* Creates an instance of [PartiqlLogical.Expr.Missing].
*/
fun missing(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Missing =
PartiqlLogical.Expr.Missing(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Lit].
*/
fun lit(
value: com.amazon.ionelement.api.IonElement,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Lit =
PartiqlLogical.Expr.Lit(
value = value.asAnyElement(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Id].
*/
fun id(
name: String,
case: CaseSensitivity,
qualifier: ScopeQualifier,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Id =
PartiqlLogical.Expr.Id(
name = name.asPrimitive(),
case = case,
qualifier = qualifier,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Id].
*
* Use this variant when metas must be passed to primitive child elements.
*
* (The "_" suffix is needed to work-around conflicts due to type erasure and ambiguities with null arguments.)
*/
fun id_(
name: org.partiql.pig.runtime.SymbolPrimitive,
case: CaseSensitivity,
qualifier: ScopeQualifier,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Id =
PartiqlLogical.Expr.Id(
name = name,
case = case,
qualifier = qualifier,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Parameter].
*/
fun parameter(
index: Long,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Parameter =
PartiqlLogical.Expr.Parameter(
index = index.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Expr.Parameter =
PartiqlLogical.Expr.Parameter(
index = index,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Not].
*/
fun not(
expr: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Not =
PartiqlLogical.Expr.Not(
expr = expr,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Pos].
*/
fun pos(
expr: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Pos =
PartiqlLogical.Expr.Pos(
expr = expr,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Neg].
*/
fun neg(
expr: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Neg =
PartiqlLogical.Expr.Neg(
expr = expr,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Plus].
*/
fun plus(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Plus =
PartiqlLogical.Expr.Plus(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Plus].
*/
fun plus(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Plus =
PartiqlLogical.Expr.Plus(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Minus].
*/
fun minus(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Minus =
PartiqlLogical.Expr.Minus(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Minus].
*/
fun minus(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Minus =
PartiqlLogical.Expr.Minus(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Times].
*/
fun times(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Times =
PartiqlLogical.Expr.Times(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Times].
*/
fun times(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Times =
PartiqlLogical.Expr.Times(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Divide].
*/
fun divide(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Divide =
PartiqlLogical.Expr.Divide(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Divide].
*/
fun divide(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Divide =
PartiqlLogical.Expr.Divide(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Modulo].
*/
fun modulo(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Modulo =
PartiqlLogical.Expr.Modulo(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Modulo].
*/
fun modulo(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Modulo =
PartiqlLogical.Expr.Modulo(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Concat].
*/
fun concat(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Concat =
PartiqlLogical.Expr.Concat(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Concat].
*/
fun concat(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Concat =
PartiqlLogical.Expr.Concat(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.And].
*/
fun and(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.And =
PartiqlLogical.Expr.And(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.And].
*/
fun and(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.And =
PartiqlLogical.Expr.And(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Or].
*/
fun or(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Or =
PartiqlLogical.Expr.Or(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Or].
*/
fun or(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Or =
PartiqlLogical.Expr.Or(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Eq].
*/
fun eq(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Eq =
PartiqlLogical.Expr.Eq(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Eq].
*/
fun eq(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Eq =
PartiqlLogical.Expr.Eq(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Ne].
*/
fun ne(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Ne =
PartiqlLogical.Expr.Ne(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Ne].
*/
fun ne(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Ne =
PartiqlLogical.Expr.Ne(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Gt].
*/
fun gt(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Gt =
PartiqlLogical.Expr.Gt(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Gt].
*/
fun gt(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Gt =
PartiqlLogical.Expr.Gt(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Gte].
*/
fun gte(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Gte =
PartiqlLogical.Expr.Gte(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Gte].
*/
fun gte(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Gte =
PartiqlLogical.Expr.Gte(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Lt].
*/
fun lt(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Lt =
PartiqlLogical.Expr.Lt(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Lt].
*/
fun lt(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Lt =
PartiqlLogical.Expr.Lt(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Lte].
*/
fun lte(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Lte =
PartiqlLogical.Expr.Lte(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Lte].
*/
fun lte(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Lte =
PartiqlLogical.Expr.Lte(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Like].
*/
fun like(
value: Expr,
pattern: Expr,
escape: Expr? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Like =
PartiqlLogical.Expr.Like(
value = value,
pattern = pattern,
escape = escape,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Between].
*/
fun between(
value: Expr,
from: Expr,
to: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Between =
PartiqlLogical.Expr.Between(
value = value,
from = from,
to = to,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.InCollection].
*/
fun inCollection(
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.InCollection =
PartiqlLogical.Expr.InCollection(
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.InCollection].
*/
fun inCollection(
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.InCollection =
PartiqlLogical.Expr.InCollection(
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.IsType].
*/
fun isType(
value: Expr,
type: Type,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.IsType =
PartiqlLogical.Expr.IsType(
value = value,
type = type,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.SimpleCase].
*/
fun simpleCase(
expr: Expr,
cases: ExprPairList,
default: Expr? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.SimpleCase =
PartiqlLogical.Expr.SimpleCase(
expr = expr,
cases = cases,
default = default,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.SearchedCase].
*/
fun searchedCase(
cases: ExprPairList,
default: Expr? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.SearchedCase =
PartiqlLogical.Expr.SearchedCase(
cases = cases,
default = default,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Bag].
*/
fun bag(
values: kotlin.collections.List = emptyList(),
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Bag =
PartiqlLogical.Expr.Bag(
values = values,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Bag].
*/
fun bag(
vararg values: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Bag =
PartiqlLogical.Expr.Bag(
values = values.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.List].
*/
fun list(
values: kotlin.collections.List = emptyList(),
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.List =
PartiqlLogical.Expr.List(
values = values,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.List].
*/
fun list(
vararg values: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.List =
PartiqlLogical.Expr.List(
values = values.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Sexp].
*/
fun sexp(
values: kotlin.collections.List = emptyList(),
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Sexp =
PartiqlLogical.Expr.Sexp(
values = values,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Sexp].
*/
fun sexp(
vararg values: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Sexp =
PartiqlLogical.Expr.Sexp(
values = values.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Date].
*/
fun date(
year: Long,
month: Long,
day: Long,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Date =
PartiqlLogical.Expr.Date(
year = year.asPrimitive(),
month = month.asPrimitive(),
day = day.asPrimitive(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Expr.Date =
PartiqlLogical.Expr.Date(
year = year,
month = month,
day = day,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.LitTime].
*/
fun litTime(
value: TimeValue,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.LitTime =
PartiqlLogical.Expr.LitTime(
value = value,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.BagOp].
*/
fun bagOp(
op: BagOpType,
quantifier: SetQuantifier,
operands: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.BagOp =
PartiqlLogical.Expr.BagOp(
op = op,
quantifier = quantifier,
operands = operands,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.BagOp].
*/
fun bagOp(
op: BagOpType,
quantifier: SetQuantifier,
operands0: Expr,
operands1: Expr,
vararg operands: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.BagOp =
PartiqlLogical.Expr.BagOp(
op = op,
quantifier = quantifier,
operands = listOf(operands0, operands1) + operands.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.GraphMatch].
*/
fun graphMatch(
expr: Expr,
gpmlPattern: GpmlPattern,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.GraphMatch =
PartiqlLogical.Expr.GraphMatch(
expr = expr,
gpmlPattern = gpmlPattern,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Path].
*/
fun path(
root: Expr,
steps: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Path =
PartiqlLogical.Expr.Path(
root = root,
steps = steps,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Path].
*/
fun path(
root: Expr,
steps0: PathStep,
vararg steps: PathStep,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Path =
PartiqlLogical.Expr.Path(
root = root,
steps = listOf(steps0) + steps.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Call].
*/
fun call(
funcName: String,
args: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Call =
PartiqlLogical.Expr.Call(
funcName = funcName.asPrimitive(),
args = args,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Expr.Call =
PartiqlLogical.Expr.Call(
funcName = funcName,
args = args,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Call].
*/
fun call(
funcName: String,
args0: Expr,
vararg args: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Call =
PartiqlLogical.Expr.Call(
funcName = funcName?.asPrimitive(),
args = listOf(args0) + args.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Expr.Call =
PartiqlLogical.Expr.Call(
funcName = funcName,
args = listOf(args0) + args.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Cast].
*/
fun cast(
value: Expr,
asType: Type,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Cast =
PartiqlLogical.Expr.Cast(
value = value,
asType = asType,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.CanCast].
*/
fun canCast(
value: Expr,
asType: Type,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.CanCast =
PartiqlLogical.Expr.CanCast(
value = value,
asType = asType,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.CanLosslessCast].
*/
fun canLosslessCast(
value: Expr,
asType: Type,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.CanLosslessCast =
PartiqlLogical.Expr.CanLosslessCast(
value = value,
asType = asType,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.NullIf].
*/
fun nullIf(
expr1: Expr,
expr2: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.NullIf =
PartiqlLogical.Expr.NullIf(
expr1 = expr1,
expr2 = expr2,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Coalesce].
*/
fun coalesce(
args: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Coalesce =
PartiqlLogical.Expr.Coalesce(
args = args,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Coalesce].
*/
fun coalesce(
args0: Expr,
vararg args: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Coalesce =
PartiqlLogical.Expr.Coalesce(
args = listOf(args0) + args.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.BindingsToValues].
*/
fun bindingsToValues(
exp: Expr,
query: Bexpr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.BindingsToValues =
PartiqlLogical.Expr.BindingsToValues(
exp = exp,
query = query,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Struct].
*/
fun struct(
parts: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Struct =
PartiqlLogical.Expr.Struct(
parts = parts,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Struct].
*/
fun struct(
parts0: StructPart,
vararg parts: StructPart,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Struct =
PartiqlLogical.Expr.Struct(
parts = listOf(parts0) + parts.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Expr.Pivot].
*/
fun pivot(
input: Bexpr,
key: Expr,
value: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Expr.Pivot =
PartiqlLogical.Expr.Pivot(
input = input,
key = key,
value = value,
metas = newMetaContainer() + metas
)
// Variants for Sum: Statement
/**
* Creates an instance of [PartiqlLogical.Statement.Query].
*/
fun query(
expr: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Statement.Query =
PartiqlLogical.Statement.Query(
expr = expr,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Statement.Exec].
*/
fun exec(
procedureName: String,
args: kotlin.collections.List = emptyList(),
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Statement.Exec =
PartiqlLogical.Statement.Exec(
procedureName = procedureName.asPrimitive(),
args = args,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Statement.Exec =
PartiqlLogical.Statement.Exec(
procedureName = procedureName,
args = args,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Statement.Exec].
*/
fun exec(
procedureName: String,
vararg args: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Statement.Exec =
PartiqlLogical.Statement.Exec(
procedureName = procedureName?.asPrimitive(),
args = args.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.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()
): PartiqlLogical.Statement.Exec =
PartiqlLogical.Statement.Exec(
procedureName = procedureName,
args = args.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Statement.Explain].
*/
fun explain(
target: ExplainTarget,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Statement.Explain =
PartiqlLogical.Statement.Explain(
target = target,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Statement.Dml].
*/
fun dml(
target: Identifier,
operation: DmlOperation,
rows: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Statement.Dml =
PartiqlLogical.Statement.Dml(
target = target,
operation = operation,
rows = rows,
metas = newMetaContainer() + metas
)
// Variants for Sum: StructPart
/**
* Creates an instance of [PartiqlLogical.StructPart.StructFields].
*/
fun structFields(
partExpr: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.StructPart.StructFields =
PartiqlLogical.StructPart.StructFields(
partExpr = partExpr,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.StructPart.StructField].
*/
fun structField(
fieldName: Expr,
value: Expr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.StructPart.StructField =
PartiqlLogical.StructPart.StructField(
fieldName = fieldName,
value = value,
metas = newMetaContainer() + metas
)
// Variants for Sum: Bexpr
/**
* Creates an instance of [PartiqlLogical.Bexpr.Scan].
*/
fun scan(
expr: Expr,
asDecl: VarDecl,
atDecl: VarDecl? = null,
byDecl: VarDecl? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Bexpr.Scan =
PartiqlLogical.Bexpr.Scan(
expr = expr,
asDecl = asDecl,
atDecl = atDecl,
byDecl = byDecl,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Bexpr.Unpivot].
*/
fun unpivot(
expr: Expr,
asDecl: VarDecl,
atDecl: VarDecl? = null,
byDecl: VarDecl? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Bexpr.Unpivot =
PartiqlLogical.Bexpr.Unpivot(
expr = expr,
asDecl = asDecl,
atDecl = atDecl,
byDecl = byDecl,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Bexpr.Filter].
*/
fun filter(
predicate: Expr,
source: Bexpr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Bexpr.Filter =
PartiqlLogical.Bexpr.Filter(
predicate = predicate,
source = source,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Bexpr.Aggregate].
*/
fun aggregate(
source: Bexpr,
strategy: GroupingStrategy,
groupList: GroupKeyList,
functionList: AggregateFunctionList,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Bexpr.Aggregate =
PartiqlLogical.Bexpr.Aggregate(
source = source,
strategy = strategy,
groupList = groupList,
functionList = functionList,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Bexpr.Join].
*/
fun join(
joinType: JoinType,
left: Bexpr,
right: Bexpr,
predicate: Expr? = null,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Bexpr.Join =
PartiqlLogical.Bexpr.Join(
joinType = joinType,
left = left,
right = right,
predicate = predicate,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Bexpr.Window].
*/
fun window(
source: Bexpr,
windowSpecification: Over,
windowExpressionList: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Bexpr.Window =
PartiqlLogical.Bexpr.Window(
source = source,
windowSpecification = windowSpecification,
windowExpressionList = windowExpressionList,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Bexpr.Window].
*/
fun window(
source: Bexpr,
windowSpecification: Over,
windowExpressionList0: WindowExpression,
vararg windowExpressionList: WindowExpression,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Bexpr.Window =
PartiqlLogical.Bexpr.Window(
source = source,
windowSpecification = windowSpecification,
windowExpressionList = listOf(windowExpressionList0) + windowExpressionList.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Bexpr.Sort].
*/
fun sort(
source: Bexpr,
sortSpecs: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Bexpr.Sort =
PartiqlLogical.Bexpr.Sort(
source = source,
sortSpecs = sortSpecs,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Bexpr.Sort].
*/
fun sort(
source: Bexpr,
sortSpecs0: SortSpec,
vararg sortSpecs: SortSpec,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Bexpr.Sort =
PartiqlLogical.Bexpr.Sort(
source = source,
sortSpecs = listOf(sortSpecs0) + sortSpecs.toList(),
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Bexpr.Offset].
*/
fun offset(
rowCount: Expr,
source: Bexpr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Bexpr.Offset =
PartiqlLogical.Bexpr.Offset(
rowCount = rowCount,
source = source,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Bexpr.Limit].
*/
fun limit(
rowCount: Expr,
source: Bexpr,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Bexpr.Limit =
PartiqlLogical.Bexpr.Limit(
rowCount = rowCount,
source = source,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Bexpr.Let].
*/
fun let(
source: Bexpr,
bindings: kotlin.collections.List,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Bexpr.Let =
PartiqlLogical.Bexpr.Let(
source = source,
bindings = bindings,
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.Bexpr.Let].
*/
fun let(
source: Bexpr,
bindings0: LetBinding,
vararg bindings: LetBinding,
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.Bexpr.Let =
PartiqlLogical.Bexpr.Let(
source = source,
bindings = listOf(bindings0) + bindings.toList(),
metas = newMetaContainer() + metas
)
// Variants for Sum: DmlOperation
/**
* Creates an instance of [PartiqlLogical.DmlOperation.DmlInsert].
*/
fun dmlInsert(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.DmlOperation.DmlInsert =
PartiqlLogical.DmlOperation.DmlInsert(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.DmlOperation.DmlDelete].
*/
fun dmlDelete(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.DmlOperation.DmlDelete =
PartiqlLogical.DmlOperation.DmlDelete(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.DmlOperation.DmlReplace].
*/
fun dmlReplace(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.DmlOperation.DmlReplace =
PartiqlLogical.DmlOperation.DmlReplace(
metas = newMetaContainer() + metas
)
/**
* Creates an instance of [PartiqlLogical.DmlOperation.DmlUpdate].
*/
fun dmlUpdate(
metas: MetaContainer = emptyMetaContainer()
): PartiqlLogical.DmlOperation.DmlUpdate =
PartiqlLogical.DmlOperation.DmlUpdate(
metas = newMetaContainer() + metas
)
}
/** Default implementation of [Builder] that uses all default method implementations. */
private object PartiqlLogicalBuilder : Builder
/** Base class for all PartiqlLogical types. */
abstract class PartiqlLogicalNode : DomainNode {
abstract override fun copy(metas: MetaContainer): PartiqlLogicalNode
override fun toString() = toIonElement().toString()
abstract override fun withMeta(metaKey: String, metaValue: Any): PartiqlLogicalNode
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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 Plan(
val stmt: Statement,
val version: org.partiql.pig.runtime.SymbolPrimitive,
override val metas: MetaContainer = emptyMetaContainer()
): PartiqlLogicalNode() {
override fun copy(metas: MetaContainer): Plan =
Plan(
stmt = stmt,
version = version,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Plan =
Plan(
stmt = stmt,
version = version,
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()) }
)
return ionSexpOf(elements, metas = metas)
}
fun copy(
stmt: Statement = this.stmt,
version: org.partiql.pig.runtime.SymbolPrimitive = this.version,
metas: MetaContainer = this.metas
) =
Plan(
stmt,
version,
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
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = stmt.hashCode()
hc = 31 * hc + version.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class LetBinding(
val value: Expr,
val decl: VarDecl,
override val metas: MetaContainer = emptyMetaContainer()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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()
): PartiqlLogicalNode() {
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 VarDecl(
val name: org.partiql.pig.runtime.SymbolPrimitive,
override val metas: MetaContainer = emptyMetaContainer()
): PartiqlLogicalNode() {
override fun copy(metas: MetaContainer): VarDecl =
VarDecl(
name = name,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): VarDecl =
VarDecl(
name = name,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("var_decl"),
name.toIonElement(),
metas = metas)
return elements
}
fun copy(
name: org.partiql.pig.runtime.SymbolPrimitive = this.name,
metas: MetaContainer = this.metas
) =
VarDecl(
name,
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 (name != other.name) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = name.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
/////////////////////////////////////////////////////////////////////////////
// Sum Types
/////////////////////////////////////////////////////////////////////////////
sealed class ExplainTarget(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 [PartiqlLogical.ExplainTarget] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.ExplainTarget): T = when(node) {
is PartiqlLogical.ExplainTarget.Domain -> convertDomain(node)
}
fun convertDomain(node: PartiqlLogical.ExplainTarget.Domain): T
}
}
sealed class PathStep(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 [PartiqlLogical.PathStep] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.PathStep): T = when(node) {
is PartiqlLogical.PathStep.PathExpr -> convertPathExpr(node)
is PartiqlLogical.PathStep.PathWildcard -> convertPathWildcard(node)
is PartiqlLogical.PathStep.PathUnpivot -> convertPathUnpivot(node)
}
fun convertPathExpr(node: PartiqlLogical.PathStep.PathExpr): T
fun convertPathWildcard(node: PartiqlLogical.PathStep.PathWildcard): T
fun convertPathUnpivot(node: PartiqlLogical.PathStep.PathUnpivot): T
}
}
sealed class JoinType(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 [PartiqlLogical.JoinType] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.JoinType): T = when(node) {
is PartiqlLogical.JoinType.Inner -> convertInner(node)
is PartiqlLogical.JoinType.Left -> convertLeft(node)
is PartiqlLogical.JoinType.Right -> convertRight(node)
is PartiqlLogical.JoinType.Full -> convertFull(node)
}
fun convertInner(node: PartiqlLogical.JoinType.Inner): T
fun convertLeft(node: PartiqlLogical.JoinType.Left): T
fun convertRight(node: PartiqlLogical.JoinType.Right): T
fun convertFull(node: PartiqlLogical.JoinType.Full): T
}
}
sealed class GraphMatchDirection(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 [PartiqlLogical.GraphMatchDirection] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.GraphMatchDirection): T = when(node) {
is PartiqlLogical.GraphMatchDirection.EdgeLeft -> convertEdgeLeft(node)
is PartiqlLogical.GraphMatchDirection.EdgeUndirected -> convertEdgeUndirected(node)
is PartiqlLogical.GraphMatchDirection.EdgeRight -> convertEdgeRight(node)
is PartiqlLogical.GraphMatchDirection.EdgeLeftOrUndirected -> convertEdgeLeftOrUndirected(node)
is PartiqlLogical.GraphMatchDirection.EdgeUndirectedOrRight -> convertEdgeUndirectedOrRight(node)
is PartiqlLogical.GraphMatchDirection.EdgeLeftOrRight -> convertEdgeLeftOrRight(node)
is PartiqlLogical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight -> convertEdgeLeftOrUndirectedOrRight(node)
}
fun convertEdgeLeft(node: PartiqlLogical.GraphMatchDirection.EdgeLeft): T
fun convertEdgeUndirected(node: PartiqlLogical.GraphMatchDirection.EdgeUndirected): T
fun convertEdgeRight(node: PartiqlLogical.GraphMatchDirection.EdgeRight): T
fun convertEdgeLeftOrUndirected(node: PartiqlLogical.GraphMatchDirection.EdgeLeftOrUndirected): T
fun convertEdgeUndirectedOrRight(node: PartiqlLogical.GraphMatchDirection.EdgeUndirectedOrRight): T
fun convertEdgeLeftOrRight(node: PartiqlLogical.GraphMatchDirection.EdgeLeftOrRight): T
fun convertEdgeLeftOrUndirectedOrRight(node: PartiqlLogical.GraphMatchDirection.EdgeLeftOrUndirectedOrRight): T
}
}
sealed class GraphMatchPatternPart(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 [PartiqlLogical.GraphMatchPatternPart] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.GraphMatchPatternPart): T = when(node) {
is PartiqlLogical.GraphMatchPatternPart.Node -> convertNode(node)
is PartiqlLogical.GraphMatchPatternPart.Edge -> convertEdge(node)
is PartiqlLogical.GraphMatchPatternPart.Pattern -> convertPattern(node)
}
fun convertNode(node: PartiqlLogical.GraphMatchPatternPart.Node): T
fun convertEdge(node: PartiqlLogical.GraphMatchPatternPart.Edge): T
fun convertPattern(node: PartiqlLogical.GraphMatchPatternPart.Pattern): T
}
}
sealed class GraphMatchRestrictor(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 [PartiqlLogical.GraphMatchRestrictor] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.GraphMatchRestrictor): T = when(node) {
is PartiqlLogical.GraphMatchRestrictor.RestrictorTrail -> convertRestrictorTrail(node)
is PartiqlLogical.GraphMatchRestrictor.RestrictorAcyclic -> convertRestrictorAcyclic(node)
is PartiqlLogical.GraphMatchRestrictor.RestrictorSimple -> convertRestrictorSimple(node)
}
fun convertRestrictorTrail(node: PartiqlLogical.GraphMatchRestrictor.RestrictorTrail): T
fun convertRestrictorAcyclic(node: PartiqlLogical.GraphMatchRestrictor.RestrictorAcyclic): T
fun convertRestrictorSimple(node: PartiqlLogical.GraphMatchRestrictor.RestrictorSimple): T
}
}
sealed class GraphMatchSelector(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 [PartiqlLogical.GraphMatchSelector] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.GraphMatchSelector): T = when(node) {
is PartiqlLogical.GraphMatchSelector.SelectorAnyShortest -> convertSelectorAnyShortest(node)
is PartiqlLogical.GraphMatchSelector.SelectorAllShortest -> convertSelectorAllShortest(node)
is PartiqlLogical.GraphMatchSelector.SelectorAny -> convertSelectorAny(node)
is PartiqlLogical.GraphMatchSelector.SelectorAnyK -> convertSelectorAnyK(node)
is PartiqlLogical.GraphMatchSelector.SelectorShortestK -> convertSelectorShortestK(node)
is PartiqlLogical.GraphMatchSelector.SelectorShortestKGroup -> convertSelectorShortestKGroup(node)
}
fun convertSelectorAnyShortest(node: PartiqlLogical.GraphMatchSelector.SelectorAnyShortest): T
fun convertSelectorAllShortest(node: PartiqlLogical.GraphMatchSelector.SelectorAllShortest): T
fun convertSelectorAny(node: PartiqlLogical.GraphMatchSelector.SelectorAny): T
fun convertSelectorAnyK(node: PartiqlLogical.GraphMatchSelector.SelectorAnyK): T
fun convertSelectorShortestK(node: PartiqlLogical.GraphMatchSelector.SelectorShortestK): T
fun convertSelectorShortestKGroup(node: PartiqlLogical.GraphMatchSelector.SelectorShortestKGroup): T
}
}
sealed class GroupingStrategy(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 [PartiqlLogical.GroupingStrategy] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.GroupingStrategy): T = when(node) {
is PartiqlLogical.GroupingStrategy.GroupFull -> convertGroupFull(node)
is PartiqlLogical.GroupingStrategy.GroupPartial -> convertGroupPartial(node)
}
fun convertGroupFull(node: PartiqlLogical.GroupingStrategy.GroupFull): T
fun convertGroupPartial(node: PartiqlLogical.GroupingStrategy.GroupPartial): T
}
}
sealed class OrderingSpec(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 [PartiqlLogical.OrderingSpec] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.OrderingSpec): T = when(node) {
is PartiqlLogical.OrderingSpec.Asc -> convertAsc(node)
is PartiqlLogical.OrderingSpec.Desc -> convertDesc(node)
}
fun convertAsc(node: PartiqlLogical.OrderingSpec.Asc): T
fun convertDesc(node: PartiqlLogical.OrderingSpec.Desc): T
}
}
sealed class NullsSpec(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 [PartiqlLogical.NullsSpec] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.NullsSpec): T = when(node) {
is PartiqlLogical.NullsSpec.NullsFirst -> convertNullsFirst(node)
is PartiqlLogical.NullsSpec.NullsLast -> convertNullsLast(node)
}
fun convertNullsFirst(node: PartiqlLogical.NullsSpec.NullsFirst): T
fun convertNullsLast(node: PartiqlLogical.NullsSpec.NullsLast): T
}
}
sealed class CaseSensitivity(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 [PartiqlLogical.CaseSensitivity] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.CaseSensitivity): T = when(node) {
is PartiqlLogical.CaseSensitivity.CaseSensitive -> convertCaseSensitive(node)
is PartiqlLogical.CaseSensitivity.CaseInsensitive -> convertCaseInsensitive(node)
}
fun convertCaseSensitive(node: PartiqlLogical.CaseSensitivity.CaseSensitive): T
fun convertCaseInsensitive(node: PartiqlLogical.CaseSensitivity.CaseInsensitive): T
}
}
sealed class ScopeQualifier(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
override fun copy(metas: MetaContainer): ScopeQualifier =
when (this) {
is Unqualified -> copy(metas = metas)
is LocalsFirst -> copy(metas = metas)
}
class Unqualified(
override val metas: MetaContainer = emptyMetaContainer()
): ScopeQualifier() {
override fun copy(metas: MetaContainer): Unqualified =
Unqualified(
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Unqualified =
Unqualified(
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("unqualified"),
metas = metas)
return elements
}
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Unqualified::class.java) return false
return true
}
override fun hashCode(): Int = 12000
}
class LocalsFirst(
override val metas: MetaContainer = emptyMetaContainer()
): ScopeQualifier() {
override fun copy(metas: MetaContainer): LocalsFirst =
LocalsFirst(
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): LocalsFirst =
LocalsFirst(
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("locals_first"),
metas = metas)
return elements
}
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != LocalsFirst::class.java) return false
return true
}
override fun hashCode(): Int = 12001
}
/** Converts instances of [PartiqlLogical.ScopeQualifier] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.ScopeQualifier): T = when(node) {
is PartiqlLogical.ScopeQualifier.Unqualified -> convertUnqualified(node)
is PartiqlLogical.ScopeQualifier.LocalsFirst -> convertLocalsFirst(node)
}
fun convertUnqualified(node: PartiqlLogical.ScopeQualifier.Unqualified): T
fun convertLocalsFirst(node: PartiqlLogical.ScopeQualifier.LocalsFirst): T
}
}
sealed class SetQuantifier(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 = 13000
}
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 = 13001
}
/** Converts instances of [PartiqlLogical.SetQuantifier] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.SetQuantifier): T = when(node) {
is PartiqlLogical.SetQuantifier.All -> convertAll(node)
is PartiqlLogical.SetQuantifier.Distinct -> convertDistinct(node)
}
fun convertAll(node: PartiqlLogical.SetQuantifier.All): T
fun convertDistinct(node: PartiqlLogical.SetQuantifier.Distinct): T
}
}
sealed class BagOpType(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 = 14000
}
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 = 14001
}
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 = 14002
}
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 = 14003
}
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 = 14004
}
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 = 14005
}
/** Converts instances of [PartiqlLogical.BagOpType] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.BagOpType): T = when(node) {
is PartiqlLogical.BagOpType.Union -> convertUnion(node)
is PartiqlLogical.BagOpType.Intersect -> convertIntersect(node)
is PartiqlLogical.BagOpType.Except -> convertExcept(node)
is PartiqlLogical.BagOpType.OuterUnion -> convertOuterUnion(node)
is PartiqlLogical.BagOpType.OuterIntersect -> convertOuterIntersect(node)
is PartiqlLogical.BagOpType.OuterExcept -> convertOuterExcept(node)
}
fun convertUnion(node: PartiqlLogical.BagOpType.Union): T
fun convertIntersect(node: PartiqlLogical.BagOpType.Intersect): T
fun convertExcept(node: PartiqlLogical.BagOpType.Except): T
fun convertOuterUnion(node: PartiqlLogical.BagOpType.OuterUnion): T
fun convertOuterIntersect(node: PartiqlLogical.BagOpType.OuterIntersect): T
fun convertOuterExcept(node: PartiqlLogical.BagOpType.OuterExcept): T
}
}
sealed class OnConflictValue(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 = 15000
}
/** Converts instances of [PartiqlLogical.OnConflictValue] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.OnConflictValue): T = when(node) {
is PartiqlLogical.OnConflictValue.Excluded -> convertExcluded(node)
}
fun convertExcluded(node: PartiqlLogical.OnConflictValue.Excluded): T
}
}
sealed class Type(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 = 16000
}
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 = 16001
}
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 = 16002
}
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 = 16003
}
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 = 16004
}
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 = 16005
}
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 = 16007
}
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 = 16008
}
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 = 16011
}
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 = 16014
}
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 = 16015
}
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 = 16016
}
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 = 16017
}
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 = 16018
}
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 = 16019
}
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 = 16022
}
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 = 16023
}
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 = 16024
}
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 = 16025
}
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 = 16026
}
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 = 16027
}
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 [PartiqlLogical.Type] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.Type): T = when(node) {
is PartiqlLogical.Type.NullType -> convertNullType(node)
is PartiqlLogical.Type.BooleanType -> convertBooleanType(node)
is PartiqlLogical.Type.SmallintType -> convertSmallintType(node)
is PartiqlLogical.Type.Integer4Type -> convertInteger4Type(node)
is PartiqlLogical.Type.Integer8Type -> convertInteger8Type(node)
is PartiqlLogical.Type.IntegerType -> convertIntegerType(node)
is PartiqlLogical.Type.FloatType -> convertFloatType(node)
is PartiqlLogical.Type.RealType -> convertRealType(node)
is PartiqlLogical.Type.DoublePrecisionType -> convertDoublePrecisionType(node)
is PartiqlLogical.Type.DecimalType -> convertDecimalType(node)
is PartiqlLogical.Type.NumericType -> convertNumericType(node)
is PartiqlLogical.Type.TimestampType -> convertTimestampType(node)
is PartiqlLogical.Type.CharacterType -> convertCharacterType(node)
is PartiqlLogical.Type.CharacterVaryingType -> convertCharacterVaryingType(node)
is PartiqlLogical.Type.MissingType -> convertMissingType(node)
is PartiqlLogical.Type.StringType -> convertStringType(node)
is PartiqlLogical.Type.SymbolType -> convertSymbolType(node)
is PartiqlLogical.Type.BlobType -> convertBlobType(node)
is PartiqlLogical.Type.ClobType -> convertClobType(node)
is PartiqlLogical.Type.DateType -> convertDateType(node)
is PartiqlLogical.Type.TimeType -> convertTimeType(node)
is PartiqlLogical.Type.TimeWithTimeZoneType -> convertTimeWithTimeZoneType(node)
is PartiqlLogical.Type.StructType -> convertStructType(node)
is PartiqlLogical.Type.TupleType -> convertTupleType(node)
is PartiqlLogical.Type.ListType -> convertListType(node)
is PartiqlLogical.Type.SexpType -> convertSexpType(node)
is PartiqlLogical.Type.BagType -> convertBagType(node)
is PartiqlLogical.Type.AnyType -> convertAnyType(node)
is PartiqlLogical.Type.CustomType -> convertCustomType(node)
}
fun convertNullType(node: PartiqlLogical.Type.NullType): T
fun convertBooleanType(node: PartiqlLogical.Type.BooleanType): T
fun convertSmallintType(node: PartiqlLogical.Type.SmallintType): T
fun convertInteger4Type(node: PartiqlLogical.Type.Integer4Type): T
fun convertInteger8Type(node: PartiqlLogical.Type.Integer8Type): T
fun convertIntegerType(node: PartiqlLogical.Type.IntegerType): T
fun convertFloatType(node: PartiqlLogical.Type.FloatType): T
fun convertRealType(node: PartiqlLogical.Type.RealType): T
fun convertDoublePrecisionType(node: PartiqlLogical.Type.DoublePrecisionType): T
fun convertDecimalType(node: PartiqlLogical.Type.DecimalType): T
fun convertNumericType(node: PartiqlLogical.Type.NumericType): T
fun convertTimestampType(node: PartiqlLogical.Type.TimestampType): T
fun convertCharacterType(node: PartiqlLogical.Type.CharacterType): T
fun convertCharacterVaryingType(node: PartiqlLogical.Type.CharacterVaryingType): T
fun convertMissingType(node: PartiqlLogical.Type.MissingType): T
fun convertStringType(node: PartiqlLogical.Type.StringType): T
fun convertSymbolType(node: PartiqlLogical.Type.SymbolType): T
fun convertBlobType(node: PartiqlLogical.Type.BlobType): T
fun convertClobType(node: PartiqlLogical.Type.ClobType): T
fun convertDateType(node: PartiqlLogical.Type.DateType): T
fun convertTimeType(node: PartiqlLogical.Type.TimeType): T
fun convertTimeWithTimeZoneType(node: PartiqlLogical.Type.TimeWithTimeZoneType): T
fun convertStructType(node: PartiqlLogical.Type.StructType): T
fun convertTupleType(node: PartiqlLogical.Type.TupleType): T
fun convertListType(node: PartiqlLogical.Type.ListType): T
fun convertSexpType(node: PartiqlLogical.Type.SexpType): T
fun convertBagType(node: PartiqlLogical.Type.BagType): T
fun convertAnyType(node: PartiqlLogical.Type.AnyType): T
fun convertCustomType(node: PartiqlLogical.Type.CustomType): T
}
}
sealed class Expr(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
override fun copy(metas: MetaContainer): Expr =
when (this) {
is Missing -> copy(metas = metas)
is Lit -> copy(metas = metas)
is Id -> copy(metas = metas)
is Parameter -> copy(metas = metas)
is Not -> copy(metas = metas)
is Pos -> copy(metas = metas)
is Neg -> copy(metas = metas)
is Plus -> copy(metas = metas)
is Minus -> copy(metas = metas)
is Times -> copy(metas = metas)
is Divide -> copy(metas = metas)
is Modulo -> copy(metas = metas)
is Concat -> copy(metas = metas)
is And -> copy(metas = metas)
is Or -> copy(metas = metas)
is Eq -> copy(metas = metas)
is Ne -> copy(metas = metas)
is Gt -> copy(metas = metas)
is Gte -> copy(metas = metas)
is Lt -> copy(metas = metas)
is Lte -> copy(metas = metas)
is Like -> copy(metas = metas)
is Between -> copy(metas = metas)
is InCollection -> copy(metas = metas)
is IsType -> copy(metas = metas)
is SimpleCase -> copy(metas = metas)
is SearchedCase -> copy(metas = metas)
is 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)
}
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 Id(
val name: org.partiql.pig.runtime.SymbolPrimitive,
val case: CaseSensitivity,
val qualifier: ScopeQualifier,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Id =
Id(
name = name,
case = case,
qualifier = qualifier,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Id =
Id(
name = name,
case = case,
qualifier = qualifier,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("id"),
name.toIonElement(),
case.toIonElement(),
qualifier.toIonElement(),
metas = metas)
return elements
}
fun copy(
name: org.partiql.pig.runtime.SymbolPrimitive = this.name,
case: CaseSensitivity = this.case,
qualifier: ScopeQualifier = this.qualifier,
metas: MetaContainer = this.metas
) =
Id(
name,
case,
qualifier,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Id::class.java) return false
other as Id
if (name != other.name) return false
if (case != other.case) return false
if (qualifier != other.qualifier) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = name.hashCode()
hc = 31 * hc + case.hashCode()
hc = 31 * hc + qualifier.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Parameter(
val index: org.partiql.pig.runtime.LongPrimitive,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Parameter =
Parameter(
index = index,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Parameter =
Parameter(
index = index,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("parameter"),
index.toIonElement(),
metas = metas)
return elements
}
fun copy(
index: org.partiql.pig.runtime.LongPrimitive = this.index,
metas: MetaContainer = this.metas
) =
Parameter(
index,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Parameter::class.java) return false
other as Parameter
if (index != other.index) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = index.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Not(
val expr: Expr,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Not =
Not(
expr = expr,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Not =
Not(
expr = expr,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("not"),
expr.toIonElement(),
metas = metas)
return elements
}
fun copy(
expr: Expr = this.expr,
metas: MetaContainer = this.metas
) =
Not(
expr,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Not::class.java) return false
other as Not
if (expr != other.expr) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = expr.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Pos(
val expr: Expr,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Pos =
Pos(
expr = expr,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Pos =
Pos(
expr = expr,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("pos"),
expr.toIonElement(),
metas = metas)
return elements
}
fun copy(
expr: Expr = this.expr,
metas: MetaContainer = this.metas
) =
Pos(
expr,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Pos::class.java) return false
other as Pos
if (expr != other.expr) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = expr.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Neg(
val expr: Expr,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Neg =
Neg(
expr = expr,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Neg =
Neg(
expr = expr,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("neg"),
expr.toIonElement(),
metas = metas)
return elements
}
fun copy(
expr: Expr = this.expr,
metas: MetaContainer = this.metas
) =
Neg(
expr,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Neg::class.java) return false
other as Neg
if (expr != other.expr) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = expr.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Plus(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Plus =
Plus(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Plus =
Plus(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("plus"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
Plus(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Plus::class.java) return false
other as Plus
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Minus(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Minus =
Minus(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Minus =
Minus(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("minus"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
Minus(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Minus::class.java) return false
other as Minus
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Times(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Times =
Times(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Times =
Times(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("times"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
Times(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Times::class.java) return false
other as Times
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Divide(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Divide =
Divide(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Divide =
Divide(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("divide"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
Divide(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Divide::class.java) return false
other as Divide
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Modulo(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Modulo =
Modulo(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Modulo =
Modulo(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("modulo"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
Modulo(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Modulo::class.java) return false
other as Modulo
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Concat(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Concat =
Concat(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Concat =
Concat(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("concat"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
Concat(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Concat::class.java) return false
other as Concat
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class And(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): And =
And(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): And =
And(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("and"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
And(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != And::class.java) return false
other as And
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Or(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Or =
Or(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Or =
Or(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("or"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
Or(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Or::class.java) return false
other as Or
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Eq(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Eq =
Eq(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Eq =
Eq(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("eq"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
Eq(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Eq::class.java) return false
other as Eq
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Ne(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Ne =
Ne(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Ne =
Ne(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("ne"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
Ne(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Ne::class.java) return false
other as Ne
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Gt(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Gt =
Gt(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Gt =
Gt(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("gt"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
Gt(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Gt::class.java) return false
other as Gt
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Gte(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Gte =
Gte(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Gte =
Gte(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("gte"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
Gte(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Gte::class.java) return false
other as Gte
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Lt(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Lt =
Lt(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Lt =
Lt(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("lt"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
Lt(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Lt::class.java) return false
other as Lt
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Lte(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Lte =
Lte(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Lte =
Lte(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("lte"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
Lte(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Lte::class.java) return false
other as Lte
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Like(
val value: Expr,
val pattern: Expr,
val escape: Expr?,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Like =
Like(
value = value,
pattern = pattern,
escape = escape,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Like =
Like(
value = value,
pattern = pattern,
escape = escape,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("like"),
value.toIonElement(),
pattern.toIonElement(),
escape?.toIonElement() ?: ionNull(),
metas = metas)
return elements
}
fun copy(
value: Expr = this.value,
pattern: Expr = this.pattern,
escape: Expr? = this.escape,
metas: MetaContainer = this.metas
) =
Like(
value,
pattern,
escape,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Like::class.java) return false
other as Like
if (value != other.value) return false
if (pattern != other.pattern) return false
if (escape != other.escape) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = value.hashCode()
hc = 31 * hc + pattern.hashCode()
hc = 31 * hc + escape.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Between(
val value: Expr,
val from: Expr,
val to: Expr,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): Between =
Between(
value = value,
from = from,
to = to,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Between =
Between(
value = value,
from = from,
to = to,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("between"),
value.toIonElement(),
from.toIonElement(),
to.toIonElement(),
metas = metas)
return elements
}
fun copy(
value: Expr = this.value,
from: Expr = this.from,
to: Expr = this.to,
metas: MetaContainer = this.metas
) =
Between(
value,
from,
to,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Between::class.java) return false
other as Between
if (value != other.value) return false
if (from != other.from) return false
if (to != other.to) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = value.hashCode()
hc = 31 * hc + from.hashCode()
hc = 31 * hc + to.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class InCollection(
val operands: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): InCollection =
InCollection(
operands = operands,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): InCollection =
InCollection(
operands = operands,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("in_collection"),
*operands.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
operands: kotlin.collections.List = this.operands,
metas: MetaContainer = this.metas
) =
InCollection(
operands,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != InCollection::class.java) return false
other as InCollection
if (operands != other.operands) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = operands.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class IsType(
val value: Expr,
val type: Type,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): IsType =
IsType(
value = value,
type = type,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): IsType =
IsType(
value = value,
type = type,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("is_type"),
value.toIonElement(),
type.toIonElement(),
metas = metas)
return elements
}
fun copy(
value: Expr = this.value,
type: Type = this.type,
metas: MetaContainer = this.metas
) =
IsType(
value,
type,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != IsType::class.java) return false
other as IsType
if (value != other.value) return false
if (type != other.type) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = value.hashCode()
hc = 31 * hc + type.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class SimpleCase(
val expr: Expr,
val cases: ExprPairList,
val default: Expr?,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): SimpleCase =
SimpleCase(
expr = expr,
cases = cases,
default = default,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): SimpleCase =
SimpleCase(
expr = expr,
cases = cases,
default = default,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("simple_case"),
expr.toIonElement(),
cases.toIonElement(),
default?.toIonElement() ?: ionNull(),
metas = metas)
return elements
}
fun copy(
expr: Expr = this.expr,
cases: ExprPairList = this.cases,
default: Expr? = this.default,
metas: MetaContainer = this.metas
) =
SimpleCase(
expr,
cases,
default,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != SimpleCase::class.java) return false
other as SimpleCase
if (expr != other.expr) return false
if (cases != other.cases) return false
if (default != other.default) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = expr.hashCode()
hc = 31 * hc + cases.hashCode()
hc = 31 * hc + default.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class SearchedCase(
val cases: ExprPairList,
val default: Expr?,
override val metas: MetaContainer = emptyMetaContainer()
): Expr() {
override fun copy(metas: MetaContainer): SearchedCase =
SearchedCase(
cases = cases,
default = default,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): SearchedCase =
SearchedCase(
cases = cases,
default = default,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("searched_case"),
cases.toIonElement(),
default?.toIonElement() ?: ionNull(),
metas = metas)
return elements
}
fun copy(
cases: ExprPairList = this.cases,
default: Expr? = this.default,
metas: MetaContainer = this.metas
) =
SearchedCase(
cases,
default,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != SearchedCase::class.java) return false
other as SearchedCase
if (cases != other.cases) return false
if (default != other.default) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = cases.hashCode()
hc = 31 * hc + default.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class 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
}
/** Converts instances of [PartiqlLogical.Expr] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.Expr): T = when(node) {
is PartiqlLogical.Expr.Missing -> convertMissing(node)
is PartiqlLogical.Expr.Lit -> convertLit(node)
is PartiqlLogical.Expr.Id -> convertId(node)
is PartiqlLogical.Expr.Parameter -> convertParameter(node)
is PartiqlLogical.Expr.Not -> convertNot(node)
is PartiqlLogical.Expr.Pos -> convertPos(node)
is PartiqlLogical.Expr.Neg -> convertNeg(node)
is PartiqlLogical.Expr.Plus -> convertPlus(node)
is PartiqlLogical.Expr.Minus -> convertMinus(node)
is PartiqlLogical.Expr.Times -> convertTimes(node)
is PartiqlLogical.Expr.Divide -> convertDivide(node)
is PartiqlLogical.Expr.Modulo -> convertModulo(node)
is PartiqlLogical.Expr.Concat -> convertConcat(node)
is PartiqlLogical.Expr.And -> convertAnd(node)
is PartiqlLogical.Expr.Or -> convertOr(node)
is PartiqlLogical.Expr.Eq -> convertEq(node)
is PartiqlLogical.Expr.Ne -> convertNe(node)
is PartiqlLogical.Expr.Gt -> convertGt(node)
is PartiqlLogical.Expr.Gte -> convertGte(node)
is PartiqlLogical.Expr.Lt -> convertLt(node)
is PartiqlLogical.Expr.Lte -> convertLte(node)
is PartiqlLogical.Expr.Like -> convertLike(node)
is PartiqlLogical.Expr.Between -> convertBetween(node)
is PartiqlLogical.Expr.InCollection -> convertInCollection(node)
is PartiqlLogical.Expr.IsType -> convertIsType(node)
is PartiqlLogical.Expr.SimpleCase -> convertSimpleCase(node)
is PartiqlLogical.Expr.SearchedCase -> convertSearchedCase(node)
is PartiqlLogical.Expr.Bag -> convertBag(node)
is PartiqlLogical.Expr.List -> convertList(node)
is PartiqlLogical.Expr.Sexp -> convertSexp(node)
is PartiqlLogical.Expr.Date -> convertDate(node)
is PartiqlLogical.Expr.LitTime -> convertLitTime(node)
is PartiqlLogical.Expr.BagOp -> convertBagOp(node)
is PartiqlLogical.Expr.GraphMatch -> convertGraphMatch(node)
is PartiqlLogical.Expr.Path -> convertPath(node)
is PartiqlLogical.Expr.Call -> convertCall(node)
is PartiqlLogical.Expr.Cast -> convertCast(node)
is PartiqlLogical.Expr.CanCast -> convertCanCast(node)
is PartiqlLogical.Expr.CanLosslessCast -> convertCanLosslessCast(node)
is PartiqlLogical.Expr.NullIf -> convertNullIf(node)
is PartiqlLogical.Expr.Coalesce -> convertCoalesce(node)
is PartiqlLogical.Expr.BindingsToValues -> convertBindingsToValues(node)
is PartiqlLogical.Expr.Struct -> convertStruct(node)
is PartiqlLogical.Expr.Pivot -> convertPivot(node)
}
fun convertMissing(node: PartiqlLogical.Expr.Missing): T
fun convertLit(node: PartiqlLogical.Expr.Lit): T
fun convertId(node: PartiqlLogical.Expr.Id): T
fun convertParameter(node: PartiqlLogical.Expr.Parameter): T
fun convertNot(node: PartiqlLogical.Expr.Not): T
fun convertPos(node: PartiqlLogical.Expr.Pos): T
fun convertNeg(node: PartiqlLogical.Expr.Neg): T
fun convertPlus(node: PartiqlLogical.Expr.Plus): T
fun convertMinus(node: PartiqlLogical.Expr.Minus): T
fun convertTimes(node: PartiqlLogical.Expr.Times): T
fun convertDivide(node: PartiqlLogical.Expr.Divide): T
fun convertModulo(node: PartiqlLogical.Expr.Modulo): T
fun convertConcat(node: PartiqlLogical.Expr.Concat): T
fun convertAnd(node: PartiqlLogical.Expr.And): T
fun convertOr(node: PartiqlLogical.Expr.Or): T
fun convertEq(node: PartiqlLogical.Expr.Eq): T
fun convertNe(node: PartiqlLogical.Expr.Ne): T
fun convertGt(node: PartiqlLogical.Expr.Gt): T
fun convertGte(node: PartiqlLogical.Expr.Gte): T
fun convertLt(node: PartiqlLogical.Expr.Lt): T
fun convertLte(node: PartiqlLogical.Expr.Lte): T
fun convertLike(node: PartiqlLogical.Expr.Like): T
fun convertBetween(node: PartiqlLogical.Expr.Between): T
fun convertInCollection(node: PartiqlLogical.Expr.InCollection): T
fun convertIsType(node: PartiqlLogical.Expr.IsType): T
fun convertSimpleCase(node: PartiqlLogical.Expr.SimpleCase): T
fun convertSearchedCase(node: PartiqlLogical.Expr.SearchedCase): T
fun convertBag(node: PartiqlLogical.Expr.Bag): T
fun convertList(node: PartiqlLogical.Expr.List): T
fun convertSexp(node: PartiqlLogical.Expr.Sexp): T
fun convertDate(node: PartiqlLogical.Expr.Date): T
fun convertLitTime(node: PartiqlLogical.Expr.LitTime): T
fun convertBagOp(node: PartiqlLogical.Expr.BagOp): T
fun convertGraphMatch(node: PartiqlLogical.Expr.GraphMatch): T
fun convertPath(node: PartiqlLogical.Expr.Path): T
fun convertCall(node: PartiqlLogical.Expr.Call): T
fun convertCast(node: PartiqlLogical.Expr.Cast): T
fun convertCanCast(node: PartiqlLogical.Expr.CanCast): T
fun convertCanLosslessCast(node: PartiqlLogical.Expr.CanLosslessCast): T
fun convertNullIf(node: PartiqlLogical.Expr.NullIf): T
fun convertCoalesce(node: PartiqlLogical.Expr.Coalesce): T
fun convertBindingsToValues(node: PartiqlLogical.Expr.BindingsToValues): T
fun convertStruct(node: PartiqlLogical.Expr.Struct): T
fun convertPivot(node: PartiqlLogical.Expr.Pivot): T
}
}
sealed class Statement(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
override fun copy(metas: MetaContainer): Statement =
when (this) {
is Query -> copy(metas = metas)
is Exec -> copy(metas = metas)
is Explain -> copy(metas = metas)
is Dml -> 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 Dml(
val target: Identifier,
val operation: DmlOperation,
val rows: Expr,
override val metas: MetaContainer = emptyMetaContainer()
): Statement() {
override fun copy(metas: MetaContainer): Dml =
Dml(
target = target,
operation = operation,
rows = rows,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Dml =
Dml(
target = target,
operation = operation,
rows = rows,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("dml"),
target.toIonElement(),
operation.toIonElement(),
rows.toIonElement(),
metas = metas)
return elements
}
fun copy(
target: Identifier = this.target,
operation: DmlOperation = this.operation,
rows: Expr = this.rows,
metas: MetaContainer = this.metas
) =
Dml(
target,
operation,
rows,
metas)
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != Dml::class.java) return false
other as Dml
if (target != other.target) return false
if (operation != other.operation) return false
if (rows != other.rows) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = target.hashCode()
hc = 31 * hc + operation.hashCode()
hc = 31 * hc + rows.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
/** Converts instances of [PartiqlLogical.Statement] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.Statement): T = when(node) {
is PartiqlLogical.Statement.Query -> convertQuery(node)
is PartiqlLogical.Statement.Exec -> convertExec(node)
is PartiqlLogical.Statement.Explain -> convertExplain(node)
is PartiqlLogical.Statement.Dml -> convertDml(node)
}
fun convertQuery(node: PartiqlLogical.Statement.Query): T
fun convertExec(node: PartiqlLogical.Statement.Exec): T
fun convertExplain(node: PartiqlLogical.Statement.Explain): T
fun convertDml(node: PartiqlLogical.Statement.Dml): T
}
}
sealed class StructPart(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
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 [PartiqlLogical.StructPart] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.StructPart): T = when(node) {
is PartiqlLogical.StructPart.StructFields -> convertStructFields(node)
is PartiqlLogical.StructPart.StructField -> convertStructField(node)
}
fun convertStructFields(node: PartiqlLogical.StructPart.StructFields): T
fun convertStructField(node: PartiqlLogical.StructPart.StructField): T
}
}
sealed class Bexpr(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
override fun copy(metas: MetaContainer): Bexpr =
when (this) {
is Scan -> copy(metas = metas)
is Unpivot -> copy(metas = metas)
is Filter -> copy(metas = metas)
is Aggregate -> copy(metas = metas)
is Join -> copy(metas = metas)
is Window -> copy(metas = metas)
is Sort -> copy(metas = metas)
is Offset -> copy(metas = metas)
is Limit -> copy(metas = metas)
is Let -> copy(metas = metas)
}
class Scan(
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(
expr = expr,
asDecl = asDecl,
atDecl = atDecl,
byDecl = byDecl,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Scan =
Scan(
expr = expr,
asDecl = asDecl,
atDecl = atDecl,
byDecl = byDecl,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("scan"),
expr.toIonElement(),
asDecl.toIonElement(),
atDecl?.toIonElement() ?: ionNull(),
byDecl?.toIonElement() ?: ionNull(),
metas = metas)
return elements
}
fun copy(
expr: Expr = this.expr,
asDecl: VarDecl = this.asDecl,
atDecl: VarDecl? = this.atDecl,
byDecl: VarDecl? = this.byDecl,
metas: MetaContainer = this.metas
) =
Scan(
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 (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 = 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 expr: Expr,
val asDecl: VarDecl,
val atDecl: VarDecl?,
val byDecl: VarDecl?,
override val metas: MetaContainer = emptyMetaContainer()
): Bexpr() {
override fun copy(metas: MetaContainer): Unpivot =
Unpivot(
expr = expr,
asDecl = asDecl,
atDecl = atDecl,
byDecl = byDecl,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Unpivot =
Unpivot(
expr = expr,
asDecl = asDecl,
atDecl = atDecl,
byDecl = byDecl,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("unpivot"),
expr.toIonElement(),
asDecl.toIonElement(),
atDecl?.toIonElement() ?: ionNull(),
byDecl?.toIonElement() ?: ionNull(),
metas = metas)
return elements
}
fun copy(
expr: Expr = this.expr,
asDecl: VarDecl = this.asDecl,
atDecl: VarDecl? = this.atDecl,
byDecl: VarDecl? = this.byDecl,
metas: MetaContainer = this.metas
) =
Unpivot(
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 (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 = 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 predicate: Expr,
val source: Bexpr,
override val metas: MetaContainer = emptyMetaContainer()
): Bexpr() {
override fun copy(metas: MetaContainer): Filter =
Filter(
predicate = predicate,
source = source,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Filter =
Filter(
predicate = predicate,
source = source,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("filter"),
predicate.toIonElement(),
source.toIonElement(),
metas = metas)
return elements
}
fun copy(
predicate: Expr = this.predicate,
source: Bexpr = this.source,
metas: MetaContainer = this.metas
) =
Filter(
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 (predicate != other.predicate) return false
if (source != other.source) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = predicate.hashCode()
hc = 31 * hc + source.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Aggregate(
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(
source = source,
strategy = strategy,
groupList = groupList,
functionList = functionList,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Aggregate =
Aggregate(
source = source,
strategy = strategy,
groupList = groupList,
functionList = functionList,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("aggregate"),
source.toIonElement(),
strategy.toIonElement(),
groupList.toIonElement(),
functionList.toIonElement(),
metas = metas)
return elements
}
fun copy(
source: Bexpr = this.source,
strategy: GroupingStrategy = this.strategy,
groupList: GroupKeyList = this.groupList,
functionList: AggregateFunctionList = this.functionList,
metas: MetaContainer = this.metas
) =
Aggregate(
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 (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 = source.hashCode()
hc = 31 * hc + strategy.hashCode()
hc = 31 * hc + groupList.hashCode()
hc = 31 * hc + functionList.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Join(
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(
joinType = joinType,
left = left,
right = right,
predicate = predicate,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Join =
Join(
joinType = joinType,
left = left,
right = right,
predicate = predicate,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("join"),
joinType.toIonElement(),
left.toIonElement(),
right.toIonElement(),
predicate?.toIonElement() ?: ionNull(),
metas = metas)
return elements
}
fun copy(
joinType: JoinType = this.joinType,
left: Bexpr = this.left,
right: Bexpr = this.right,
predicate: Expr? = this.predicate,
metas: MetaContainer = this.metas
) =
Join(
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 (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 = joinType.hashCode()
hc = 31 * hc + left.hashCode()
hc = 31 * hc + right.hashCode()
hc = 31 * hc + predicate.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Window(
val source: Bexpr,
val windowSpecification: Over,
val windowExpressionList: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Bexpr() {
override fun copy(metas: MetaContainer): Window =
Window(
source = source,
windowSpecification = windowSpecification,
windowExpressionList = windowExpressionList,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Window =
Window(
source = source,
windowSpecification = windowSpecification,
windowExpressionList = windowExpressionList,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("window"),
source.toIonElement(),
windowSpecification.toIonElement(),
*windowExpressionList.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
source: Bexpr = this.source,
windowSpecification: Over = this.windowSpecification,
windowExpressionList: kotlin.collections.List = this.windowExpressionList,
metas: MetaContainer = this.metas
) =
Window(
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 (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 = source.hashCode()
hc = 31 * hc + windowSpecification.hashCode()
hc = 31 * hc + windowExpressionList.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Sort(
val source: Bexpr,
val sortSpecs: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Bexpr() {
override fun copy(metas: MetaContainer): Sort =
Sort(
source = source,
sortSpecs = sortSpecs,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Sort =
Sort(
source = source,
sortSpecs = sortSpecs,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("sort"),
source.toIonElement(),
*sortSpecs.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
source: Bexpr = this.source,
sortSpecs: kotlin.collections.List = this.sortSpecs,
metas: MetaContainer = this.metas
) =
Sort(
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 (source != other.source) return false
if (sortSpecs != other.sortSpecs) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = source.hashCode()
hc = 31 * hc + sortSpecs.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Offset(
val rowCount: Expr,
val source: Bexpr,
override val metas: MetaContainer = emptyMetaContainer()
): Bexpr() {
override fun copy(metas: MetaContainer): Offset =
Offset(
rowCount = rowCount,
source = source,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Offset =
Offset(
rowCount = rowCount,
source = source,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("offset"),
rowCount.toIonElement(),
source.toIonElement(),
metas = metas)
return elements
}
fun copy(
rowCount: Expr = this.rowCount,
source: Bexpr = this.source,
metas: MetaContainer = this.metas
) =
Offset(
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 (rowCount != other.rowCount) return false
if (source != other.source) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = rowCount.hashCode()
hc = 31 * hc + source.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Limit(
val rowCount: Expr,
val source: Bexpr,
override val metas: MetaContainer = emptyMetaContainer()
): Bexpr() {
override fun copy(metas: MetaContainer): Limit =
Limit(
rowCount = rowCount,
source = source,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Limit =
Limit(
rowCount = rowCount,
source = source,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("limit"),
rowCount.toIonElement(),
source.toIonElement(),
metas = metas)
return elements
}
fun copy(
rowCount: Expr = this.rowCount,
source: Bexpr = this.source,
metas: MetaContainer = this.metas
) =
Limit(
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 (rowCount != other.rowCount) return false
if (source != other.source) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = rowCount.hashCode()
hc = 31 * hc + source.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
class Let(
val source: Bexpr,
val bindings: kotlin.collections.List,
override val metas: MetaContainer = emptyMetaContainer()
): Bexpr() {
override fun copy(metas: MetaContainer): Let =
Let(
source = source,
bindings = bindings,
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): Let =
Let(
source = source,
bindings = bindings,
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("let"),
source.toIonElement(),
*bindings.map { it.toIonElement() }.toTypedArray(),
metas = metas)
return elements
}
fun copy(
source: Bexpr = this.source,
bindings: kotlin.collections.List = this.bindings,
metas: MetaContainer = this.metas
) =
Let(
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 (source != other.source) return false
if (bindings != other.bindings) return false
return true
}
private val myHashCode by lazy(LazyThreadSafetyMode.PUBLICATION) {
var hc = source.hashCode()
hc = 31 * hc + bindings.hashCode()
hc
}
override fun hashCode(): Int = myHashCode
}
/** Converts instances of [PartiqlLogical.Bexpr] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.Bexpr): T = when(node) {
is PartiqlLogical.Bexpr.Scan -> convertScan(node)
is PartiqlLogical.Bexpr.Unpivot -> convertUnpivot(node)
is PartiqlLogical.Bexpr.Filter -> convertFilter(node)
is PartiqlLogical.Bexpr.Aggregate -> convertAggregate(node)
is PartiqlLogical.Bexpr.Join -> convertJoin(node)
is PartiqlLogical.Bexpr.Window -> convertWindow(node)
is PartiqlLogical.Bexpr.Sort -> convertSort(node)
is PartiqlLogical.Bexpr.Offset -> convertOffset(node)
is PartiqlLogical.Bexpr.Limit -> convertLimit(node)
is PartiqlLogical.Bexpr.Let -> convertLet(node)
}
fun convertScan(node: PartiqlLogical.Bexpr.Scan): T
fun convertUnpivot(node: PartiqlLogical.Bexpr.Unpivot): T
fun convertFilter(node: PartiqlLogical.Bexpr.Filter): T
fun convertAggregate(node: PartiqlLogical.Bexpr.Aggregate): T
fun convertJoin(node: PartiqlLogical.Bexpr.Join): T
fun convertWindow(node: PartiqlLogical.Bexpr.Window): T
fun convertSort(node: PartiqlLogical.Bexpr.Sort): T
fun convertOffset(node: PartiqlLogical.Bexpr.Offset): T
fun convertLimit(node: PartiqlLogical.Bexpr.Limit): T
fun convertLet(node: PartiqlLogical.Bexpr.Let): T
}
}
sealed class DmlOperation(override val metas: MetaContainer = emptyMetaContainer()) : PartiqlLogicalNode() {
override fun copy(metas: MetaContainer): DmlOperation =
when (this) {
is DmlInsert -> copy(metas = metas)
is DmlDelete -> copy(metas = metas)
is DmlReplace -> copy(metas = metas)
is DmlUpdate -> copy(metas = metas)
}
class DmlInsert(
override val metas: MetaContainer = emptyMetaContainer()
): DmlOperation() {
override fun copy(metas: MetaContainer): DmlInsert =
DmlInsert(
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): DmlInsert =
DmlInsert(
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("dml_insert"),
metas = metas)
return elements
}
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != DmlInsert::class.java) return false
return true
}
override fun hashCode(): Int = 21000
}
class DmlDelete(
override val metas: MetaContainer = emptyMetaContainer()
): DmlOperation() {
override fun copy(metas: MetaContainer): DmlDelete =
DmlDelete(
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): DmlDelete =
DmlDelete(
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("dml_delete"),
metas = metas)
return elements
}
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != DmlDelete::class.java) return false
return true
}
override fun hashCode(): Int = 21001
}
class DmlReplace(
override val metas: MetaContainer = emptyMetaContainer()
): DmlOperation() {
override fun copy(metas: MetaContainer): DmlReplace =
DmlReplace(
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): DmlReplace =
DmlReplace(
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("dml_replace"),
metas = metas)
return elements
}
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != DmlReplace::class.java) return false
return true
}
override fun hashCode(): Int = 21002
}
class DmlUpdate(
override val metas: MetaContainer = emptyMetaContainer()
): DmlOperation() {
override fun copy(metas: MetaContainer): DmlUpdate =
DmlUpdate(
metas = metas)
override fun withMeta(metaKey: String, metaValue: Any): DmlUpdate =
DmlUpdate(
metas = metas + metaContainerOf(metaKey to metaValue))
override fun toIonElement(): SexpElement {
val elements = ionSexpOf(
ionSymbol("dml_update"),
metas = metas)
return elements
}
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this === other) return true
if (other.javaClass != DmlUpdate::class.java) return false
return true
}
override fun hashCode(): Int = 21003
}
/** Converts instances of [PartiqlLogical.DmlOperation] to any [T]. */
interface Converter {
fun convert(node: PartiqlLogical.DmlOperation): T = when(node) {
is PartiqlLogical.DmlOperation.DmlInsert -> convertDmlInsert(node)
is PartiqlLogical.DmlOperation.DmlDelete -> convertDmlDelete(node)
is PartiqlLogical.DmlOperation.DmlReplace -> convertDmlReplace(node)
is PartiqlLogical.DmlOperation.DmlUpdate -> convertDmlUpdate(node)
}
fun convertDmlInsert(node: PartiqlLogical.DmlOperation.DmlInsert): T
fun convertDmlDelete(node: PartiqlLogical.DmlOperation.DmlDelete): T
fun convertDmlReplace(node: PartiqlLogical.DmlOperation.DmlReplace): T
fun convertDmlUpdate(node: PartiqlLogical.DmlOperation.DmlUpdate): T
}
}
/////////////////////////////////////////////////////////////////////////////
// IonElementTransformer
/////////////////////////////////////////////////////////////////////////////
private class IonElementTransformer : IonElementTransformerBase() {
override fun innerTransform(sexp: SexpElement): PartiqlLogicalNode {
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()
PartiqlLogical.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()
PartiqlLogical.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() }
PartiqlLogical.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() }
PartiqlLogical.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()
PartiqlLogical.ExprPair(
first,
second,
metas = sexp.metas)
}
"expr_pair_list" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val pairs = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.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()
PartiqlLogical.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()
PartiqlLogical.Over(
partitionBy,
orderBy,
metas = sexp.metas)
}
"window_partition_list" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val exprs = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.WindowPartitionList(
exprs,
metas = sexp.metas)
}
"window_sort_spec_list" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val sortSpecs = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.WindowSortSpecList(
sortSpecs,
metas = sexp.metas)
}
"identifier" -> {
sexp.requireArityOrMalformed(IntRange(2, 2))
val name = sexp.getRequired(0).toSymbolPrimitive()
val case = sexp.getRequired(1).transformExpect()
PartiqlLogical.Identifier(
name,
case,
metas = sexp.metas)
}
"plan" -> {
val ir = sexp.transformToIntermediateRecord()
val stmt = ir.processRequiredField("stmt") { it.transformExpect() }
val version = ir.processRequiredField("version") { it.toSymbolPrimitive() }
ir.malformedIfAnyUnprocessedFieldsRemain()
Plan(stmt, version, metas = sexp.metas)
}
"let_binding" -> {
sexp.requireArityOrMalformed(IntRange(2, 2))
val value = sexp.getRequired(0).transformExpect()
val decl = sexp.getRequired(1).transformExpect()
PartiqlLogical.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()
PartiqlLogical.GroupKey(
expr,
asVar,
metas = sexp.metas)
}
"group_key_list" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val keys = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.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()
PartiqlLogical.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() }
PartiqlLogical.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() }
PartiqlLogical.WindowExpression(
decl,
funcName,
args,
metas = sexp.metas)
}
"var_decl" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val name = sexp.getRequired(0).toSymbolPrimitive()
PartiqlLogical.VarDecl(
name,
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()
PartiqlLogical.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()
PartiqlLogical.PathStep.PathExpr(
index,
case,
metas = sexp.metas)
}
"path_wildcard" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.PathStep.PathWildcard(
metas = sexp.metas)
}
"path_unpivot" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.PathStep.PathUnpivot(
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'JoinType'
//////////////////////////////////////
"inner" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.JoinType.Inner(
metas = sexp.metas)
}
"left" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.JoinType.Left(
metas = sexp.metas)
}
"right" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.JoinType.Right(
metas = sexp.metas)
}
"full" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.JoinType.Full(
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'GraphMatchDirection'
//////////////////////////////////////
"edge_left" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GraphMatchDirection.EdgeLeft(
metas = sexp.metas)
}
"edge_undirected" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GraphMatchDirection.EdgeUndirected(
metas = sexp.metas)
}
"edge_right" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GraphMatchDirection.EdgeRight(
metas = sexp.metas)
}
"edge_left_or_undirected" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GraphMatchDirection.EdgeLeftOrUndirected(
metas = sexp.metas)
}
"edge_undirected_or_right" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GraphMatchDirection.EdgeUndirectedOrRight(
metas = sexp.metas)
}
"edge_left_or_right" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GraphMatchDirection.EdgeLeftOrRight(
metas = sexp.metas)
}
"edge_left_or_undirected_or_right" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.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() }
PartiqlLogical.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() }
PartiqlLogical.GraphMatchPatternPart.Edge(
direction,
quantifier,
prefilter,
variable,
label,
metas = sexp.metas)
}
"pattern" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val pattern = sexp.getRequired(0).transformExpect()
PartiqlLogical.GraphMatchPatternPart.Pattern(
pattern,
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'GraphMatchRestrictor'
//////////////////////////////////////
"restrictor_trail" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GraphMatchRestrictor.RestrictorTrail(
metas = sexp.metas)
}
"restrictor_acyclic" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GraphMatchRestrictor.RestrictorAcyclic(
metas = sexp.metas)
}
"restrictor_simple" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GraphMatchRestrictor.RestrictorSimple(
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'GraphMatchSelector'
//////////////////////////////////////
"selector_any_shortest" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GraphMatchSelector.SelectorAnyShortest(
metas = sexp.metas)
}
"selector_all_shortest" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GraphMatchSelector.SelectorAllShortest(
metas = sexp.metas)
}
"selector_any" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GraphMatchSelector.SelectorAny(
metas = sexp.metas)
}
"selector_any_k" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val k = sexp.getRequired(0).toLongPrimitive()
PartiqlLogical.GraphMatchSelector.SelectorAnyK(
k,
metas = sexp.metas)
}
"selector_shortest_k" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val k = sexp.getRequired(0).toLongPrimitive()
PartiqlLogical.GraphMatchSelector.SelectorShortestK(
k,
metas = sexp.metas)
}
"selector_shortest_k_group" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val k = sexp.getRequired(0).toLongPrimitive()
PartiqlLogical.GraphMatchSelector.SelectorShortestKGroup(
k,
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'GroupingStrategy'
//////////////////////////////////////
"group_full" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GroupingStrategy.GroupFull(
metas = sexp.metas)
}
"group_partial" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.GroupingStrategy.GroupPartial(
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'OrderingSpec'
//////////////////////////////////////
"asc" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.OrderingSpec.Asc(
metas = sexp.metas)
}
"desc" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.OrderingSpec.Desc(
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'NullsSpec'
//////////////////////////////////////
"nulls_first" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.NullsSpec.NullsFirst(
metas = sexp.metas)
}
"nulls_last" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.NullsSpec.NullsLast(
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'CaseSensitivity'
//////////////////////////////////////
"case_sensitive" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.CaseSensitivity.CaseSensitive(
metas = sexp.metas)
}
"case_insensitive" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.CaseSensitivity.CaseInsensitive(
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'ScopeQualifier'
//////////////////////////////////////
"unqualified" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.ScopeQualifier.Unqualified(
metas = sexp.metas)
}
"locals_first" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.ScopeQualifier.LocalsFirst(
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'SetQuantifier'
//////////////////////////////////////
"all" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.SetQuantifier.All(
metas = sexp.metas)
}
"distinct" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.SetQuantifier.Distinct(
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'BagOpType'
//////////////////////////////////////
"union" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.BagOpType.Union(
metas = sexp.metas)
}
"intersect" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.BagOpType.Intersect(
metas = sexp.metas)
}
"except" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.BagOpType.Except(
metas = sexp.metas)
}
"outer_union" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.BagOpType.OuterUnion(
metas = sexp.metas)
}
"outer_intersect" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.BagOpType.OuterIntersect(
metas = sexp.metas)
}
"outer_except" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.BagOpType.OuterExcept(
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'OnConflictValue'
//////////////////////////////////////
"excluded" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.OnConflictValue.Excluded(
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'Type'
//////////////////////////////////////
"null_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.NullType(
metas = sexp.metas)
}
"boolean_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.BooleanType(
metas = sexp.metas)
}
"smallint_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.SmallintType(
metas = sexp.metas)
}
"integer4_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.Integer4Type(
metas = sexp.metas)
}
"integer8_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.Integer8Type(
metas = sexp.metas)
}
"integer_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.IntegerType(
metas = sexp.metas)
}
"float_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 1))
val precision = sexp.getOptional(0)?.toLongPrimitive()
PartiqlLogical.Type.FloatType(
precision,
metas = sexp.metas)
}
"real_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.RealType(
metas = sexp.metas)
}
"double_precision_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.DoublePrecisionType(
metas = sexp.metas)
}
"decimal_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 2))
val precision = sexp.getOptional(0)?.toLongPrimitive()
val scale = sexp.getOptional(1)?.toLongPrimitive()
PartiqlLogical.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()
PartiqlLogical.Type.NumericType(
precision,
scale,
metas = sexp.metas)
}
"timestamp_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.TimestampType(
metas = sexp.metas)
}
"character_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 1))
val length = sexp.getOptional(0)?.toLongPrimitive()
PartiqlLogical.Type.CharacterType(
length,
metas = sexp.metas)
}
"character_varying_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 1))
val length = sexp.getOptional(0)?.toLongPrimitive()
PartiqlLogical.Type.CharacterVaryingType(
length,
metas = sexp.metas)
}
"missing_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.MissingType(
metas = sexp.metas)
}
"string_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.StringType(
metas = sexp.metas)
}
"symbol_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.SymbolType(
metas = sexp.metas)
}
"blob_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.BlobType(
metas = sexp.metas)
}
"clob_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.ClobType(
metas = sexp.metas)
}
"date_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.DateType(
metas = sexp.metas)
}
"time_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 1))
val precision = sexp.getOptional(0)?.toLongPrimitive()
PartiqlLogical.Type.TimeType(
precision,
metas = sexp.metas)
}
"time_with_time_zone_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 1))
val precision = sexp.getOptional(0)?.toLongPrimitive()
PartiqlLogical.Type.TimeWithTimeZoneType(
precision,
metas = sexp.metas)
}
"struct_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.StructType(
metas = sexp.metas)
}
"tuple_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.TupleType(
metas = sexp.metas)
}
"list_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.ListType(
metas = sexp.metas)
}
"sexp_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.SexpType(
metas = sexp.metas)
}
"bag_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.BagType(
metas = sexp.metas)
}
"any_type" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Type.AnyType(
metas = sexp.metas)
}
"custom_type" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val name = sexp.getRequired(0).toSymbolPrimitive()
PartiqlLogical.Type.CustomType(
name,
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'Expr'
//////////////////////////////////////
"missing" -> {
sexp.requireArityOrMalformed(IntRange(0, 0))
PartiqlLogical.Expr.Missing(
metas = sexp.metas)
}
"lit" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val value = sexp.getRequiredIon(0)
PartiqlLogical.Expr.Lit(
value,
metas = sexp.metas)
}
"id" -> {
sexp.requireArityOrMalformed(IntRange(3, 3))
val name = sexp.getRequired(0).toSymbolPrimitive()
val case = sexp.getRequired(1).transformExpect()
val qualifier = sexp.getRequired(2).transformExpect()
PartiqlLogical.Expr.Id(
name,
case,
qualifier,
metas = sexp.metas)
}
"parameter" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val index = sexp.getRequired(0).toLongPrimitive()
PartiqlLogical.Expr.Parameter(
index,
metas = sexp.metas)
}
"not" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val expr = sexp.getRequired(0).transformExpect()
PartiqlLogical.Expr.Not(
expr,
metas = sexp.metas)
}
"pos" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val expr = sexp.getRequired(0).transformExpect()
PartiqlLogical.Expr.Pos(
expr,
metas = sexp.metas)
}
"neg" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val expr = sexp.getRequired(0).transformExpect()
PartiqlLogical.Expr.Neg(
expr,
metas = sexp.metas)
}
"plus" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.Plus(
operands,
metas = sexp.metas)
}
"minus" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.Minus(
operands,
metas = sexp.metas)
}
"times" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.Times(
operands,
metas = sexp.metas)
}
"divide" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.Divide(
operands,
metas = sexp.metas)
}
"modulo" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.Modulo(
operands,
metas = sexp.metas)
}
"concat" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.Concat(
operands,
metas = sexp.metas)
}
"and" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.And(
operands,
metas = sexp.metas)
}
"or" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.Or(
operands,
metas = sexp.metas)
}
"eq" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.Eq(
operands,
metas = sexp.metas)
}
"ne" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.Ne(
operands,
metas = sexp.metas)
}
"gt" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.Gt(
operands,
metas = sexp.metas)
}
"gte" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.Gte(
operands,
metas = sexp.metas)
}
"lt" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.Lt(
operands,
metas = sexp.metas)
}
"lte" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.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()
PartiqlLogical.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()
PartiqlLogical.Expr.Between(
value,
from,
to,
metas = sexp.metas)
}
"in_collection" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val operands = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.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()
PartiqlLogical.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()
PartiqlLogical.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()
PartiqlLogical.Expr.SearchedCase(
cases,
default,
metas = sexp.metas)
}
"bag" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val values = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.Bag(
values,
metas = sexp.metas)
}
"list" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val values = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.Expr.List(
values,
metas = sexp.metas)
}
"sexp" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val values = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.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()
PartiqlLogical.Expr.Date(
year,
month,
day,
metas = sexp.metas)
}
"lit_time" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val value = sexp.getRequired(0).transformExpect()
PartiqlLogical.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() }
PartiqlLogical.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()
PartiqlLogical.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() }
PartiqlLogical.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() }
PartiqlLogical.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()
PartiqlLogical.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()
PartiqlLogical.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()
PartiqlLogical.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()
PartiqlLogical.Expr.NullIf(
expr1,
expr2,
metas = sexp.metas)
}
"coalesce" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val args = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.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()
PartiqlLogical.Expr.BindingsToValues(
exp,
query,
metas = sexp.metas)
}
"struct" -> {
sexp.requireArityOrMalformed(IntRange(0, 2147483647))
val parts = sexp.values.drop(1).map { it.transformExpect() }
PartiqlLogical.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()
PartiqlLogical.Expr.Pivot(
input,
key,
value,
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'Statement'
//////////////////////////////////////
"query" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val expr = sexp.getRequired(0).transformExpect()
PartiqlLogical.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() }
PartiqlLogical.Statement.Exec(
procedureName,
args,
metas = sexp.metas)
}
"explain" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val target = sexp.getRequired(0).transformExpect()
PartiqlLogical.Statement.Explain(
target,
metas = sexp.metas)
}
"dml" -> {
sexp.requireArityOrMalformed(IntRange(3, 3))
val target = sexp.getRequired(0).transformExpect()
val operation = sexp.getRequired(1).transformExpect()
val rows = sexp.getRequired(2).transformExpect()
PartiqlLogical.Statement.Dml(
target,
operation,
rows,
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'StructPart'
//////////////////////////////////////
"struct_fields" -> {
sexp.requireArityOrMalformed(IntRange(1, 1))
val partExpr = sexp.getRequired(0).transformExpect()
PartiqlLogical.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()
PartiqlLogical.StructPart.StructField(
fieldName,
value,
metas = sexp.metas)
}
//////////////////////////////////////
// Variants for Sum Type 'Bexpr'
//////////////////////////////////////
"scan" -> {
sexp.requireArityOrMalformed(IntRange(2, 4))
val expr = sexp.getRequired(0).transformExpect()
val asDecl = sexp.getRequired(1).transformExpect()
val atDecl = sexp.getOptional(2)?.transformExpect()
val byDecl = sexp.getOptional(3)?.transformExpect()
PartiqlLogical.Bexpr.Scan(
expr,
asDecl,
atDecl,
byDecl,
metas = sexp.metas)
}
"unpivot" -> {
sexp.requireArityOrMalformed(IntRange(2, 4))
val expr = sexp.getRequired(0).transformExpect()
val asDecl = sexp.getRequired(1).transformExpect