Skip to content

Commit e388628

Browse files
committed
update naming of 'WITH' planner flag and fn
1 parent 3008f49 commit e388628

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

partiql-planner/api/partiql-planner.api

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public final class org/partiql/planner/builder/PartiQLPlannerBuilder {
2929
public final fun addPass (Lorg/partiql/planner/PartiQLPlannerPass;)Lorg/partiql/planner/builder/PartiQLPlannerBuilder;
3030
public final fun addPasses ([Lorg/partiql/planner/PartiQLPlannerPass;)Lorg/partiql/planner/builder/PartiQLPlannerBuilder;
3131
public final fun build ()Lorg/partiql/planner/PartiQLPlanner;
32-
public final fun replaceWithReferences (Z)Lorg/partiql/planner/builder/PartiQLPlannerBuilder;
33-
public static synthetic fun replaceWithReferences$default (Lorg/partiql/planner/builder/PartiQLPlannerBuilder;ZILjava/lang/Object;)Lorg/partiql/planner/builder/PartiQLPlannerBuilder;
32+
public final fun forceInlineWithClause (Z)Lorg/partiql/planner/builder/PartiQLPlannerBuilder;
33+
public static synthetic fun forceInlineWithClause$default (Lorg/partiql/planner/builder/PartiQLPlannerBuilder;ZILjava/lang/Object;)Lorg/partiql/planner/builder/PartiQLPlannerBuilder;
3434
public final fun signal (Z)Lorg/partiql/planner/builder/PartiQLPlannerBuilder;
3535
public static synthetic fun signal$default (Lorg/partiql/planner/builder/PartiQLPlannerBuilder;ZILjava/lang/Object;)Lorg/partiql/planner/builder/PartiQLPlannerBuilder;
3636
}

partiql-planner/src/main/kotlin/org/partiql/planner/builder/PartiQLPlannerBuilder.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import org.partiql.planner.internal.SqlPlanner
1818
*/
1919
public class PartiQLPlannerBuilder {
2020

21-
private val flags: MutableSet<PlannerFlag> = mutableSetOf(PlannerFlag.REPLACE_WITH_REFS)
21+
private val flags: MutableSet<PlannerFlag> = mutableSetOf(PlannerFlag.FORCE_INLINE_WITH_CLAUSE)
2222
private val passes: MutableList<PartiQLPlannerPass> = mutableListOf()
2323

2424
/**
@@ -70,11 +70,11 @@ public class PartiQLPlannerBuilder {
7070
* @param replaceWith denotes whether to replace WITH variable references with their definitions.
7171
* @return
7272
*/
73-
public fun replaceWithReferences(replaceWith: Boolean = true): PartiQLPlannerBuilder {
73+
public fun forceInlineWithClause(replaceWith: Boolean = true): PartiQLPlannerBuilder {
7474
if (replaceWith) {
75-
flags.add(PlannerFlag.REPLACE_WITH_REFS)
75+
flags.add(PlannerFlag.FORCE_INLINE_WITH_CLAUSE)
7676
} else {
77-
flags.remove(PlannerFlag.REPLACE_WITH_REFS)
77+
flags.remove(PlannerFlag.FORCE_INLINE_WITH_CLAUSE)
7878
}
7979
return this
8080
}

partiql-planner/src/main/kotlin/org/partiql/planner/internal/PlannerFlag.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ internal enum class PlannerFlag {
2222
* Experimental flag to enable planner to replace references to WITH variables with their definitions.
2323
* By default, this flag is included in the default planner phase.
2424
*/
25-
REPLACE_WITH_REFS
25+
FORCE_INLINE_WITH_CLAUSE
2626
}

partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/PlanTyper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ internal class PlanTyper(private val env: Env, config: Context, private val flag
295295
element.copy(representation = representation)
296296
}
297297
// Include the WITH elements iff the `flags` contains the `REPLACE_WITH_REFS` planner flag.
298-
val rewriteWith = flags.contains(PlannerFlag.REPLACE_WITH_REFS)
298+
val rewriteWith = flags.contains(PlannerFlag.FORCE_INLINE_WITH_CLAUSE)
299299
val withElements = if (rewriteWith) {
300300
elements
301301
} else {

partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/PlanTyperTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class PlanTyperTest {
129129
.build(),
130130
config.errorListener
131131
)
132-
return PlanTyperWrapper(PlanTyper(env, config, setOf(PlannerFlag.REPLACE_WITH_REFS)))
132+
return PlanTyperWrapper(PlanTyper(env, config, setOf(PlannerFlag.FORCE_INLINE_WITH_CLAUSE)))
133133
}
134134
}
135135

0 commit comments

Comments
 (0)