Skip to content

Commit a8cb9fb

Browse files
authored
Explicit snapshot prefix (#243)
* Add an explicit prefix to Snapshot * Update SDKs * Extend test case
1 parent 84fe7a1 commit a8cb9fb

20 files changed

Lines changed: 13717 additions & 13615 deletions

File tree

meta/src/meta/grammar.y

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,9 +1261,11 @@ snapshot_mapping
12611261
$2: logic.RelationId = $$.source_relation
12621262

12631263
snapshot
1264-
: "(" "snapshot" snapshot_mapping* ")"
1265-
construct: $$ = transactions.Snapshot(mappings=$3)
1266-
deconstruct: $3: Sequence[transactions.SnapshotMapping] = $$.mappings
1264+
: "(" "snapshot" edb_path snapshot_mapping* ")"
1265+
construct: $$ = transactions.Snapshot(prefix=$3, mappings=$4)
1266+
deconstruct:
1267+
$3: Sequence[String] = $$.prefix
1268+
$4: Sequence[transactions.SnapshotMapping] = $$.mappings
12671269

12681270
epoch_reads
12691271
: "(" "reads" read* ")"

proto/relationalai/lqp/v1/transactions.proto

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,20 @@ message Context {
6464
repeated RelationId relations = 1;
6565
}
6666

67-
// A single (destination, source) pair within a Snapshot action.
67+
// A single (destination, source) pair within a Snapshot action. The destination_path is
68+
// relative to the Snapshot's prefix.
6869
message SnapshotMapping {
6970
repeated string destination_path = 1;
7071
RelationId source_relation = 2;
7172
}
7273

7374
// Demand the source IDBs, take immutable snapshots, and turn them into EDBs under the
74-
// given paths (specified as sequences of strings, see EDB).
75+
// given paths (specified as sequences of strings, see EDB). If a prefix is specified,
76+
// the engine should treat this as a complete snapshot of all EDBs under that prefix,
77+
// removing any pre-existing EDBs for the same prefix that are not in the mappings.
7578
message Snapshot {
7679
repeated SnapshotMapping mappings = 1;
80+
repeated string prefix = 2;
7781
}
7882

7983
//

sdks/go/src/lqp/v1/transactions.pb.go

Lines changed: 186 additions & 173 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdks/go/src/parser.go

Lines changed: 2750 additions & 2748 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)