Skip to content

Commit 84c3236

Browse files
hbarthelsclaude
andcommitted
Rename Relations/OutputRelation to TargetRelations/TargetRelation
Rename the generalized CSV-loading proto messages Relations -> TargetRelations and OutputRelation -> TargetRelation, plus the matching grammar nonterminals (relations -> target_relations, output_relation -> target_relation) and all comments. The LQP s-expression syntax is unchanged: the (relations …)/(relation …)/(inserts …)/(deletes …) keywords, proto field names, and wire format are all preserved (no .bin or pretty-snapshot changes). Regenerated parsers, printers, and protobuf bindings for all three SDKs; updated hand-written Julia equality. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d862b96 commit 84c3236

14 files changed

Lines changed: 636 additions & 635 deletions

File tree

meta/src/meta/grammar.y

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@
8989
%nonterm gnf_columns Sequence[logic.GNFColumn]
9090
%nonterm named_column logic.NamedColumn
9191
%nonterm relation_keys Sequence[logic.NamedColumn]
92-
%nonterm output_relation logic.OutputRelation
93-
%nonterm non_cdc_relations Sequence[logic.OutputRelation]
94-
%nonterm cdc_inserts Sequence[logic.OutputRelation]
95-
%nonterm cdc_deletes Sequence[logic.OutputRelation]
96-
%nonterm relation_body logic.Relations
97-
%nonterm relations logic.Relations
92+
%nonterm target_relation logic.TargetRelation
93+
%nonterm non_cdc_relations Sequence[logic.TargetRelation]
94+
%nonterm cdc_inserts Sequence[logic.TargetRelation]
95+
%nonterm cdc_deletes Sequence[logic.TargetRelation]
96+
%nonterm relation_body logic.TargetRelations
97+
%nonterm target_relations logic.TargetRelations
9898
%nonterm csv_config logic.CSVConfig
9999
%nonterm csv_data logic.CSVData
100100
%nonterm csv_locator_inline_data String
@@ -1115,13 +1115,13 @@ csv_asof
11151115
: "(" "asof" STRING ")"
11161116

11171117
csv_data
1118-
: "(" "csv_data" csvlocator csv_config gnf_columns? relations? csv_asof ")"
1118+
: "(" "csv_data" csvlocator csv_config gnf_columns? target_relations? csv_asof ")"
11191119
construct: $$ = construct_csv_data($3, $4, $5, $6, $7)
11201120
deconstruct:
11211121
$3: logic.CSVLocator = $$.locator
11221122
$4: logic.CSVConfig = $$.config
11231123
$5: Optional[Sequence[logic.GNFColumn]] = deconstruct_csv_data_columns_optional($$)
1124-
$6: Optional[logic.Relations] = deconstruct_csv_data_relations_optional($$)
1124+
$6: Optional[logic.TargetRelations] = deconstruct_csv_data_relations_optional($$)
11251125
$7: String = $$.asof
11261126

11271127
named_column
@@ -1134,39 +1134,39 @@ named_column
11341134
relation_keys
11351135
: "(" "keys" named_column* ")"
11361136

1137-
output_relation
1137+
target_relation
11381138
: "(" "relation" relation_id named_column* ")"
1139-
construct: $$ = logic.OutputRelation(target_id=$3, values=$4)
1139+
construct: $$ = logic.TargetRelation(target_id=$3, values=$4)
11401140
deconstruct:
11411141
$3: logic.RelationId = $$.target_id
11421142
$4: Sequence[logic.NamedColumn] = $$.values
11431143

11441144
non_cdc_relations
1145-
: output_relation*
1145+
: target_relation*
11461146

11471147
cdc_inserts
1148-
: "(" "inserts" output_relation* ")"
1148+
: "(" "inserts" target_relation* ")"
11491149

11501150
cdc_deletes
1151-
: "(" "deletes" output_relation* ")"
1151+
: "(" "deletes" target_relation* ")"
11521152

11531153
relation_body
11541154
: non_cdc_relations
11551155
construct: $$ = construct_non_cdc_relations($1)
11561156
deconstruct if builtin.is_empty($$.inserts) and builtin.is_empty($$.deletes):
1157-
$1: Sequence[logic.OutputRelation] = $$.relations
1157+
$1: Sequence[logic.TargetRelation] = $$.relations
11581158
| cdc_inserts cdc_deletes
11591159
construct: $$ = construct_cdc_relations($1, $2)
11601160
deconstruct if not (builtin.is_empty($$.inserts) and builtin.is_empty($$.deletes)):
1161-
$1: Sequence[logic.OutputRelation] = $$.inserts
1162-
$2: Sequence[logic.OutputRelation] = $$.deletes
1161+
$1: Sequence[logic.TargetRelation] = $$.inserts
1162+
$2: Sequence[logic.TargetRelation] = $$.deletes
11631163

1164-
relations
1164+
target_relations
11651165
: "(" "relations" relation_keys relation_body ")"
11661166
construct: $$ = construct_relations($3, $4)
11671167
deconstruct:
11681168
$3: Sequence[logic.NamedColumn] = $$.keys
1169-
$4: logic.Relations = $$
1169+
$4: logic.TargetRelations = $$
11701170

11711171
csv_locator_paths
11721172
: "(" "paths" STRING* ")"
@@ -1527,33 +1527,33 @@ def _try_extract_value_string_list(value: Optional[logic.Value]) -> Optional[Seq
15271527

15281528

15291529
def construct_non_cdc_relations(
1530-
relations: Sequence[logic.OutputRelation],
1531-
) -> logic.Relations:
1532-
return logic.Relations(
1530+
relations: Sequence[logic.TargetRelation],
1531+
) -> logic.TargetRelations:
1532+
return logic.TargetRelations(
15331533
keys=list[logic.NamedColumn](),
15341534
relations=relations,
1535-
inserts=list[logic.OutputRelation](),
1536-
deletes=list[logic.OutputRelation](),
1535+
inserts=list[logic.TargetRelation](),
1536+
deletes=list[logic.TargetRelation](),
15371537
)
15381538

15391539

15401540
def construct_cdc_relations(
1541-
inserts: Sequence[logic.OutputRelation],
1542-
deletes: Sequence[logic.OutputRelation],
1543-
) -> logic.Relations:
1544-
return logic.Relations(
1541+
inserts: Sequence[logic.TargetRelation],
1542+
deletes: Sequence[logic.TargetRelation],
1543+
) -> logic.TargetRelations:
1544+
return logic.TargetRelations(
15451545
keys=list[logic.NamedColumn](),
1546-
relations=list[logic.OutputRelation](),
1546+
relations=list[logic.TargetRelation](),
15471547
inserts=inserts,
15481548
deletes=deletes,
15491549
)
15501550

15511551

15521552
def construct_relations(
15531553
keys: Sequence[logic.NamedColumn],
1554-
body: logic.Relations,
1555-
) -> logic.Relations:
1556-
return logic.Relations(
1554+
body: logic.TargetRelations,
1555+
) -> logic.TargetRelations:
1556+
return logic.TargetRelations(
15571557
keys=keys,
15581558
relations=body.relations,
15591559
inserts=body.inserts,
@@ -1565,7 +1565,7 @@ def construct_csv_data(
15651565
locator: logic.CSVLocator,
15661566
config: logic.CSVConfig,
15671567
columns_opt: Optional[Sequence[logic.GNFColumn]],
1568-
relations_opt: Optional[logic.Relations],
1568+
relations_opt: Optional[logic.TargetRelations],
15691569
asof: String,
15701570
) -> logic.CSVData:
15711571
return logic.CSVData(
@@ -1583,7 +1583,7 @@ def deconstruct_csv_data_columns_optional(msg: logic.CSVData) -> Optional[Sequen
15831583
return builtin.some(msg.columns)
15841584

15851585

1586-
def deconstruct_csv_data_relations_optional(msg: logic.CSVData) -> Optional[logic.Relations]:
1586+
def deconstruct_csv_data_relations_optional(msg: logic.CSVData) -> Optional[logic.TargetRelations]:
15871587
if builtin.has_proto_field(msg, "relations"):
15881588
return builtin.some(builtin.unwrap_option(msg.relations))
15891589
return builtin.none()

proto/relationalai/lqp/v1/logic.proto

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -289,35 +289,35 @@ message StorageIntegration {
289289
}
290290

291291
// A single named CSV column with its type. Used to describe both shared key columns and
292-
// per-relation value columns in the generalized `Relations` loading construct.
292+
// per-relation value columns in the generalized `TargetRelations` loading construct.
293293
message NamedColumn {
294294
string name = 1; // CSV column name (e.g. "src"); special name "METADATA$KEY" => derived hash
295295
Type type = 2; // Column type
296296
}
297297

298-
// One output relation: the shared keys plus this relation's own (possibly empty) value columns.
299-
message OutputRelation {
298+
// One target relation: the shared keys plus this relation's own (possibly empty) value columns.
299+
message TargetRelation {
300300
RelationId target_id = 1; // Output relation path
301301
repeated NamedColumn values = 2; // Value columns for this relation (may be empty)
302302
}
303303

304-
// Generalized CSV loading: a shared set of key columns and one or more output relations.
304+
// Generalized CSV loading: a shared set of key columns and one or more target relations.
305305
// CDC vs non-CDC is implied by which group is populated:
306306
// - `relations` populated => non-CDC outputs
307307
// - `inserts`/`deletes` => CDC insert/delete groups
308-
message Relations {
308+
message TargetRelations {
309309
repeated NamedColumn keys = 1; // Shared key columns (name "METADATA$KEY" => derived hash)
310-
repeated OutputRelation relations = 2; // Non-CDC outputs
311-
repeated OutputRelation inserts = 3; // CDC insert group
312-
repeated OutputRelation deletes = 4; // CDC delete group
310+
repeated TargetRelation relations = 2; // Non-CDC outputs
311+
repeated TargetRelation inserts = 3; // CDC insert group
312+
repeated TargetRelation deletes = 4; // CDC delete group
313313
}
314314

315315
message CSVData {
316316
CSVLocator locator = 1;
317317
CSVConfig config = 2;
318318
repeated GNFColumn columns = 3;
319319
string asof = 4; // Blob storage timestamp for freshness requirements
320-
optional Relations relations = 5; // If present, generalized loading; mutually exclusive with columns
320+
optional TargetRelations relations = 5; // If present, generalized loading; mutually exclusive with columns
321321
}
322322

323323
message CSVLocator {

0 commit comments

Comments
 (0)