diff --git a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/Compiler.kt b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/Compiler.kt index 2a9adf5a4a..f032723f6c 100644 --- a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/Compiler.kt +++ b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/Compiler.kt @@ -191,7 +191,7 @@ internal class Compiler( override fun visitRelOpAggregateCall(node: Rel.Op.Aggregate.Call, ctx: PType?): Operator.Aggregation { val args = node.args.map { visitRex(it, it.type).modeHandled() } - val setQuantifier: Operator.Aggregation.SetQuantifier = when (node.setQuantifier) { + val setQuantifier: Operator.Aggregation.SetQuantifier = when (node.setq) { SetQuantifier.ALL -> Operator.Aggregation.SetQuantifier.ALL SetQuantifier.DISTINCT -> Operator.Aggregation.SetQuantifier.DISTINCT } diff --git a/partiql-plan/api/partiql-plan.api b/partiql-plan/api/partiql-plan.api index 18bb0bf545..6365a92f9f 100644 --- a/partiql-plan/api/partiql-plan.api +++ b/partiql-plan/api/partiql-plan.api @@ -350,7 +350,7 @@ public final class org/partiql/plan/Rel$Op$Aggregate$Call : org/partiql/plan/Pla public static final field Companion Lorg/partiql/plan/Rel$Op$Aggregate$Call$Companion; public final field agg Lorg/partiql/plan/Ref; public final field args Ljava/util/List; - public final field setQuantifier Lorg/partiql/plan/SetQuantifier; + public final field setq Lorg/partiql/plan/SetQuantifier; public fun (Lorg/partiql/plan/Ref;Lorg/partiql/plan/SetQuantifier;Ljava/util/List;)V public fun accept (Lorg/partiql/plan/visitor/PlanVisitor;Ljava/lang/Object;)Ljava/lang/Object; public static final fun builder ()Lorg/partiql/plan/builder/RelOpAggregateCallBuilder; @@ -1832,11 +1832,11 @@ public final class org/partiql/plan/builder/RelOpAggregateCallBuilder { public final fun build ()Lorg/partiql/plan/Rel$Op$Aggregate$Call; public final fun getAgg ()Lorg/partiql/plan/Ref; public final fun getArgs ()Ljava/util/List; - public final fun getSetQuantifier ()Lorg/partiql/plan/SetQuantifier; + public final fun getSetq ()Lorg/partiql/plan/SetQuantifier; public final fun setAgg (Lorg/partiql/plan/Ref;)V public final fun setArgs (Ljava/util/List;)V - public final fun setQuantifier (Lorg/partiql/plan/SetQuantifier;)Lorg/partiql/plan/builder/RelOpAggregateCallBuilder; - public final fun setSetQuantifier (Lorg/partiql/plan/SetQuantifier;)V + public final fun setSetq (Lorg/partiql/plan/SetQuantifier;)V + public final fun setq (Lorg/partiql/plan/SetQuantifier;)Lorg/partiql/plan/builder/RelOpAggregateCallBuilder; } public final class org/partiql/plan/builder/RelOpDistinctBuilder { diff --git a/partiql-plan/src/main/resources/partiql_plan.ion b/partiql-plan/src/main/resources/partiql_plan.ion index a384e67b2d..08225e341b 100644 --- a/partiql-plan/src/main/resources/partiql_plan.ion +++ b/partiql-plan/src/main/resources/partiql_plan.ion @@ -342,7 +342,7 @@ rel::{ _: [ call::{ agg: ref, - set_quantifier: set_quantifier, + setq: set_quantifier, args: list::[rex], }, ], diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/ir/Nodes.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/ir/Nodes.kt index 7176b4f446..e74019b898 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/ir/Nodes.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/ir/Nodes.kt @@ -1234,7 +1234,7 @@ internal data class Rel( internal data class Unresolved( @JvmField internal val name: String, - @JvmField internal val setQuantifier: SetQuantifier, + @JvmField internal val setq: SetQuantifier, @JvmField internal val args: List, ) : Call() { public override val children: List by lazy { @@ -1255,7 +1255,7 @@ internal data class Rel( internal data class Resolved( @JvmField internal val agg: Ref.Agg, - @JvmField internal val setQuantifier: SetQuantifier, + @JvmField internal val setq: SetQuantifier, @JvmField internal val args: List, ) : Call() { public override val children: List by lazy { diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/PlanTransform.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/PlanTransform.kt index bd7dd65706..93943ebc90 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/PlanTransform.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/PlanTransform.kt @@ -414,7 +414,7 @@ internal class PlanTransform( override fun visitRelOpAggregateCallResolved(node: Rel.Op.Aggregate.Call.Resolved, ctx: Unit): PlanNode { val agg = visitRef(node.agg, ctx) val args = node.args.map { visitRex(it, ctx) } - val setQuantifier = visitSetQuantifier(node.setQuantifier) + val setQuantifier = visitSetQuantifier(node.setq) return org.partiql.plan.relOpAggregateCall(agg, setQuantifier, args) } diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/PlanTyper.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/PlanTyper.kt index 6717dea83c..92601f163f 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/PlanTyper.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/PlanTyper.kt @@ -1291,10 +1291,10 @@ internal class PlanTyper(private val env: Env) { fun resolveAgg(node: Rel.Op.Aggregate.Call.Unresolved): Pair { // Type the arguments val args = node.args.map { visitRex(it, null) } - val argsResolved = Rel.Op.Aggregate.Call.Unresolved(node.name, node.setQuantifier, args) + val argsResolved = Rel.Op.Aggregate.Call.Unresolved(node.name, node.setq, args) // Resolve the function - val call = env.resolveAgg(node.name, node.setQuantifier, args) ?: return argsResolved to CompilerType(PType.dynamic()) + val call = env.resolveAgg(node.name, node.setq, args) ?: return argsResolved to CompilerType(PType.dynamic()) return call to CompilerType(call.agg.signature.returns) } } diff --git a/partiql-planner/src/main/resources/partiql_plan_internal.ion b/partiql-planner/src/main/resources/partiql_plan_internal.ion index dbfafd9486..9d9ae45184 100644 --- a/partiql-planner/src/main/resources/partiql_plan_internal.ion +++ b/partiql-planner/src/main/resources/partiql_plan_internal.ion @@ -358,12 +358,12 @@ rel::{ call::[ unresolved::{ name: string, - set_quantifier: set_quantifier, + setq: set_quantifier, args: list::[rex], }, resolved::{ agg: '.ref.agg', - set_quantifier: set_quantifier, + setq: set_quantifier, args: list::[rex], }, ],