Skip to content

Commit b5fc8b5

Browse files
Action Protos - Action fields for JiT execution (#2076)
Protobuf changes required for a basic JiT execution in @dataform/core.
1 parent 057fc6a commit b5fc8b5

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

protos/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ proto_library(
1313
"execution.proto",
1414
"profiles.proto",
1515
],
16+
deps = ["@com_google_protobuf//:struct_proto"],
1617
)
1718

1819
ts_proto_library(

protos/core.proto

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,25 @@ message CompilationError {
100100
string stack = 3;
101101
}
102102

103+
// Compilation mode, unspecified is interpreted to AoT.
104+
enum ActionCompilationMode {
105+
ACTION_COMPILATION_MODE_UNSPECIFIED = 0;
106+
// Ahead-of-time compilation (regular Dataform compilation).
107+
ACTION_COMPILATION_MODE_AOT = 1;
108+
// Just-in-time compilation.
109+
// Will only populate jit_code fields in compiled graph,
110+
// to be re-compiled at execution time.
111+
ACTION_COMPILATION_MODE_JIT = 2;
112+
}
113+
103114
message ActionDescriptor {
104115
string description = 1;
105116
// For Operations, 'columns' may be set iff has_output == true.
106117
// For Assertions, 'columns' will always be empty.
107118
repeated ColumnDescriptor columns = 2;
108119
map<string, string> bigquery_labels = 3;
109120
Metadata metadata = 4;
121+
ActionCompilationMode compilation_mode = 5;
110122
}
111123

112124
message Metadata {
@@ -188,6 +200,8 @@ message Table {
188200
repeated string incremental_pre_ops = 28;
189201
repeated string incremental_post_ops = 29;
190202

203+
string jit_code = 38;
204+
191205
// Warehouse specific features.
192206
BigQueryOptions bigquery = 22;
193207

@@ -207,6 +221,7 @@ message Operation {
207221
bool disabled = 14;
208222

209223
repeated string queries = 6;
224+
string jit_code = 15;
210225
bool has_output = 8;
211226
repeated string tags = 9;
212227

@@ -264,6 +279,8 @@ message Test {
264279
string test_query = 2;
265280
string expected_output_query = 3;
266281

282+
string jit_code = 10;
283+
267284
// Generated.
268285
string file_name = 4;
269286

@@ -379,6 +396,8 @@ message CompiledGraph {
379396

380397
repeated Target targets = 11;
381398

399+
google.protobuf.Struct jit_context = 15;
400+
382401
reserved 5, 6;
383402
}
384403

0 commit comments

Comments
 (0)