Skip to content

Commit

Permalink
Rename set_quantifier -> setq
Browse files Browse the repository at this point in the history
  • Loading branch information
alancai98 committed Aug 15, 2024
1 parent bdec62a commit ab5cf7b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions partiql-plan/api/partiql-plan.api
Original file line number Diff line number Diff line change
Expand Up @@ -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 <init> (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;
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion partiql-plan/src/main/resources/partiql_plan.ion
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ rel::{
_: [
call::{
agg: ref,
set_quantifier: set_quantifier,
setq: set_quantifier,
args: list::[rex],
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Rex>,
) : Call() {
public override val children: List<PlanNode> by lazy {
Expand All @@ -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<Rex>,
) : Call() {
public override val children: List<PlanNode> by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1291,10 +1291,10 @@ internal class PlanTyper(private val env: Env) {
fun resolveAgg(node: Rel.Op.Aggregate.Call.Unresolved): Pair<Rel.Op.Aggregate.Call, CompilerType> {
// 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)
}
}
Expand Down
4 changes: 2 additions & 2 deletions partiql-planner/src/main/resources/partiql_plan_internal.ion
Original file line number Diff line number Diff line change
Expand Up @@ -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],
},
],
Expand Down

0 comments on commit ab5cf7b

Please sign in to comment.