Skip to content

Commit c23ca8c

Browse files
authored
Internalizes the IR used by PlanTyper (#1270)
* Makes unresolved plan internal * Ktlint, include error nodes, fix tests * Addresses PR comments
1 parent 63f8b72 commit c23ca8c

File tree

28 files changed

+4623
-2566
lines changed

28 files changed

+4623
-2566
lines changed

partiql-plan/README.adoc

Lines changed: 0 additions & 2013 deletions
This file was deleted.

partiql-plan/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ val generate = tasks.register<Exec>("generate") {
5252
"--poems", "builder",
5353
"--poems", "util",
5454
"--opt-in", "org.partiql.value.PartiQLValueExperimental",
55-
"./src/main/resources/partiql_plan_0_1.ion"
55+
"./src/main/resources/partiql_plan.ion"
5656
)
5757
}
5858

partiql-plan/src/main/resources/partiql_plan_0_1.ion renamed to partiql-plan/src/main/resources/partiql_plan.ion

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@ imports::{
88
}
99

1010
parti_q_l_plan::{
11-
version: parti_q_l_version, // version :: (major minor)
1211
globals: list::[global], // (globals ...)
1312
statement: statement, // (statement ...)
1413
}
1514

16-
parti_q_l_version::[
17-
VERSION_0_0,
18-
VERSION_0_1, // CURRENT
19-
]
20-
2115
// Globals
2216

2317
global::{
@@ -28,26 +22,17 @@ global::{
2822
// Functions
2923

3024
fn::[
31-
resolved::{
25+
static::{
3226
signature: scalar_signature,
3327
},
34-
unresolved::{
35-
identifier: identifier,
36-
isHidden: bool,
37-
},
3828
dynamic::{
3929
signatures: list::[scalar_signature],
4030
}
4131
]
4232

43-
agg::[
44-
resolved::{
45-
signature: aggregation_signature,
46-
},
47-
unresolved::{
48-
identifier: identifier,
49-
},
50-
]
33+
agg::{
34+
signature: aggregation_signature,
35+
}
5136

5237
// Statements
5338

@@ -85,21 +70,9 @@ rex::{
8570
value: partiql_value,
8671
},
8772

88-
var::[
89-
resolved::{
90-
ref: int,
91-
},
92-
unresolved::{
93-
identifier: identifier,
94-
scope: scope,
95-
},
96-
_::[
97-
scope::[
98-
DEFAULT, // x.y.z
99-
LOCAL, // @x.y.z
100-
],
101-
],
102-
],
73+
var::{
74+
ref: int,
75+
},
10376

10477
global::{
10578
ref: int,
@@ -133,15 +106,9 @@ rex::{
133106
args: list::[rex],
134107
candidates: list::[candidate],
135108
_: [
136-
137-
// Represents a viable candidate.
138-
//
139-
// fn: The resolved function
140-
// coercions: Represents the coercion that should take place -- if not null. The first item is to be wrapped
141-
// over the first argument of dynamic.args and so on.
142109
candidate::{
143-
fn: '.fn.resolved',
144-
coercions: list::[optional::'.fn.resolved']
110+
fn: fn,
111+
coercions: list::[optional::fn]
145112
}
146113
]
147114
}

partiql-plan/src/main/resources/partiql_plan_0_0.ion

Lines changed: 0 additions & 266 deletions
This file was deleted.

partiql-planner/src/main/kotlin/org/partiql/planner/Header.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.partiql.planner
22

3-
import org.partiql.planner.typer.TypeLattice
3+
import org.partiql.planner.internal.typer.TypeLattice
44
import org.partiql.types.function.FunctionParameter
55
import org.partiql.types.function.FunctionSignature
66
import org.partiql.value.PartiQLValueExperimental

0 commit comments

Comments
 (0)