Skip to content

Commit 10bb4e6

Browse files
feat: integrate JiT compilation and finalize test suite
* feat: enable JiT compilation in CLI run, build and compile commands - Connect main CLI execution flow to the JiT worker process - Add comprehensive JiT test suite - Finalize AoT build logic to preserve JiT-specific fields - Update CLI console and entry points for integrated JiT support
1 parent e51e27c commit 10bb4e6

32 files changed

Lines changed: 648 additions & 733 deletions

cli/BUILD

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,13 @@ ts_test_suite(
6565
"index_project_test.ts",
6666
"index_compile_test.ts",
6767
"index_run_e2e_test.ts",
68-
"index_jit_main_test.ts",
69-
"index_jit_advanced_test.ts",
70-
"index_jit_dependency_test.ts",
71-
"index_jit_runtime_test.ts",
68+
"tests/jit/index_jit_main_test.ts",
69+
"tests/jit/index_jit_advanced_test.ts",
70+
"tests/jit/index_jit_dependency_test.ts",
71+
"tests/jit/index_jit_runtime_test.ts",
7272
"util_test.ts",
73-
"jit_build_test.ts",
74-
"jit_rpc_test.ts",
75-
"jit_run_test.ts",
76-
"bigquery_test.ts"
73+
"tests/jit/jit_build_test.ts",
74+
"tests/jit/jit_run_test.ts",
7775
],
7876
data = [
7977
":node_modules",

cli/api/commands/base_worker.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ export abstract class BaseWorker<TResponse, TMessage = any> {
1515

1616
return new Promise((resolve, reject) => {
1717
let completed = false;
18+
let booted = false;
1819

1920
const terminate = (fn: () => void) => {
2021
if (completed) {
2122
return;
2223
}
2324
completed = true;
2425
clearTimeout(timeout);
25-
child.kill();
26+
child.kill("SIGKILL");
2627
fn();
2728
};
2829

@@ -34,7 +35,10 @@ export abstract class BaseWorker<TResponse, TMessage = any> {
3435

3536
child.on("message", (message: any) => {
3637
if (message.type === "worker_booted") {
37-
onBoot(child);
38+
if (!booted) {
39+
booted = true;
40+
onBoot(child);
41+
}
3842
return;
3943
}
4044
onMessage(message, child, (res) => terminate(() => resolve(res)), (err) => terminate(() => reject(err)));

cli/api/commands/build.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ export class Builder {
8383
...this.toPartialExecutionAction(table),
8484
type: "table",
8585
tableType: utils.tableTypeEnumToString(table.enumType),
86-
tasks: table.disabled
87-
? []
88-
: this.executionSql.publishTasks(table, runConfig, tableMetadata).build(),
86+
tasks: this.executionSql.createTableTasks(table, runConfig, tableMetadata),
8987
hermeticity: table.hermeticity || dataform.ActionHermeticity.HERMETIC
9088
};
9189
}
@@ -94,9 +92,7 @@ export class Builder {
9492
return {
9593
...this.toPartialExecutionAction(operation),
9694
type: "operation",
97-
tasks: operation.disabled
98-
? []
99-
: operation.queries.map(statement => ({ type: "statement", statement })),
95+
tasks: this.executionSql.createOperationTasks(operation),
10096
hermeticity: operation.hermeticity || dataform.ActionHermeticity.NON_HERMETIC
10197
};
10298
}
@@ -105,9 +101,7 @@ export class Builder {
105101
return {
106102
...this.toPartialExecutionAction(assertion),
107103
type: "assertion",
108-
tasks: assertion.disabled
109-
? []
110-
: this.executionSql.assertTasks(assertion, this.prunedGraph.projectConfig).build(),
104+
tasks: this.executionSql.createAssertionTasks(assertion),
111105
hermeticity: assertion.hermeticity || dataform.ActionHermeticity.HERMETIC
112106
};
113107
}
@@ -126,9 +120,6 @@ export class Builder {
126120
if (jitCode) {
127121
executionAction.jitCode = jitCode;
128122
}
129-
if (this.prunedGraph.jitData) {
130-
executionAction.jitData = this.prunedGraph.jitData;
131-
}
132123
return executionAction;
133124
}
134125
}

cli/api/commands/jit_compile_child_process.ts

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

cli/api/commands/jit_rpc.ts

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

0 commit comments

Comments
 (0)