Commit f031138
authored
* graph: parse skipDuplicates from @entity directive
Add kw::SKIP_DUPLICATES constant, skip_duplicates bool field to ObjectType,
and parsing logic in ObjectType::new() defaulting to false when absent.
* graph: validate skipDuplicates directive argument
Added SkipDuplicatesRequiresImmutable error variant, bool_arg validation
for skipDuplicates in validate_entity_directives(), and three test functions
covering non-boolean value, mutable entity, and timeseries+skipDuplicates.
* graph: expose skip_duplicates on EntityType and InputSchema APIs
Add TypeInfo::skip_duplicates(), InputSchema::skip_duplicates(), and
EntityType::skip_duplicates() following the is_immutable() three-layer
delegation pattern. Object types return immutable && skip_duplicates;
Interface and Aggregation types return false.
* graph, store: propagate skip_duplicates to RowGroup
Add skip_duplicates: bool field to RowGroup struct alongside immutable,
update RowGroup::new() to accept the parameter, and wire it from
entity_type.skip_duplicates() in RowGroups::group_entry(). All other
call sites (RowGroupForPerfTest, test helpers, example) pass false.
* graph, store: lenient write-batch enforcement for skip_duplicates
Modify RowGroup::append_row() so that when immutable=true and
skip_duplicates=true, cross-block duplicate inserts and
Overwrite/Remove operations log warnings and return Ok(()) instead
of failing. Same-block duplicates remain allowed. Default behavior
(skip_duplicates=false) is preserved exactly.
Added Logger field to RowGroup/RowGroups with CacheWeight impl,
threaded through all construction sites. 5 unit tests covering all
scenarios.
* store: propagate skip_duplicates to Table
Added skip_duplicates: bool field to Table struct in relational.rs,
wired from EntityType::skip_duplicates() in Table::new(), copied in
Table::new_like(), and defaulted to false in make_poi_table().
* store: lenient store-layer enforcement for skip_duplicates
Added logger parameter to Layout::update() and Layout::delete() in
relational.rs. When table.immutable && table.skip_duplicates, these
methods now log a warning and return Ok(0) instead of returning an
error. Default immutable behavior (skip_duplicates=false) is preserved.
Updated all callers including deployment_store.rs and test files.
Added 4 unit tests with SkipDupMink entity type to verify both
skip_duplicates and default immutable behavior.
* store: ON CONFLICT DO NOTHING for skip_duplicates inserts
Add conditional ON CONFLICT (primary_key) DO NOTHING clause to
InsertQuery::walk_ast() when table.immutable && table.skip_duplicates.
This handles cross-batch duplicates where an entity committed in a
previous batch is re-inserted due to the immutable entity cache
skipping store lookups.
Two unit tests verify: skip_duplicates inserts include ON CONFLICT,
default immutable inserts do not.
* store: log cross-batch duplicate inserts in Layout::insert()
Restructured Layout::insert() from if-let-Err to match to capture
affected_rows from InsertQuery::execute(). Tracks expected vs actual
row counts across both the main batch path and the row-by-row fallback
path. Logs a warning when affected_rows < expected for skip_duplicates
immutable tables.
* tests: runner test for skipDuplicates immutable entities
Add end-to-end runner test exercising @entity(immutable: true,
skipDuplicates: true) with duplicate entity inserts across blocks.
- tests/runner-tests/skip-duplicates/: subgraph with Ping entity using
skipDuplicates, block handler that saves same ID every block
- tests/tests/runner_tests.rs: skip_duplicates() test syncs 4 blocks
and verifies entity is queryable (indexing did not fail)
* graph, store: address review comments
- Remove logs and the logger from the RowGroup
- Simplify schema tests
- Add ObjectMutability enum instead of two booleans
1 parent 4a00e8c commit f031138
22 files changed
Lines changed: 500 additions & 76 deletions
File tree
- graph
- examples
- src
- components/store
- schema
- input
- test_schemas
- util
- store
- postgres/src
- relational
- test-store/tests/postgres
- tests
- runner-tests/skip-duplicates
- abis
- src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
338 | 340 | | |
339 | 341 | | |
340 | 342 | | |
| 343 | + | |
341 | 344 | | |
342 | 345 | | |
343 | 346 | | |
344 | 347 | | |
345 | 348 | | |
346 | | - | |
347 | | - | |
348 | 349 | | |
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
354 | | - | |
| 355 | + | |
355 | 356 | | |
356 | 357 | | |
357 | 358 | | |
358 | | - | |
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
474 | | - | |
| 474 | + | |
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
| |||
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
491 | 494 | | |
492 | 495 | | |
493 | 496 | | |
| |||
498 | 501 | | |
499 | 502 | | |
500 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
501 | 507 | | |
502 | 508 | | |
503 | 509 | | |
| |||
604 | 610 | | |
605 | 611 | | |
606 | 612 | | |
607 | | - | |
608 | | - | |
| 613 | + | |
| 614 | + | |
609 | 615 | | |
610 | 616 | | |
611 | 617 | | |
| |||
661 | 667 | | |
662 | 668 | | |
663 | 669 | | |
| 670 | + | |
664 | 671 | | |
665 | 672 | | |
666 | 673 | | |
667 | | - | |
668 | | - | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
669 | 679 | | |
670 | 680 | | |
671 | 681 | | |
| |||
684 | 694 | | |
685 | 695 | | |
686 | 696 | | |
687 | | - | |
688 | | - | |
689 | | - | |
| 697 | + | |
690 | 698 | | |
691 | 699 | | |
692 | 700 | | |
| |||
784 | 792 | | |
785 | 793 | | |
786 | 794 | | |
| 795 | + | |
787 | 796 | | |
788 | 797 | | |
789 | 798 | | |
| |||
797 | 806 | | |
798 | 807 | | |
799 | 808 | | |
800 | | - | |
| 809 | + | |
801 | 810 | | |
802 | 811 | | |
803 | 812 | | |
| |||
1079 | 1088 | | |
1080 | 1089 | | |
1081 | 1090 | | |
1082 | | - | |
1083 | 1091 | | |
1084 | 1092 | | |
1085 | 1093 | | |
| |||
1120 | 1128 | | |
1121 | 1129 | | |
1122 | 1130 | | |
| 1131 | + | |
| 1132 | + | |
1123 | 1133 | | |
1124 | 1134 | | |
1125 | 1135 | | |
| |||
1128 | 1138 | | |
1129 | 1139 | | |
1130 | 1140 | | |
| 1141 | + | |
| 1142 | + | |
1131 | 1143 | | |
1132 | 1144 | | |
1133 | 1145 | | |
| |||
1187 | 1199 | | |
1188 | 1200 | | |
1189 | 1201 | | |
1190 | | - | |
| 1202 | + | |
1191 | 1203 | | |
1192 | 1204 | | |
1193 | 1205 | | |
| |||
1292 | 1304 | | |
1293 | 1305 | | |
1294 | 1306 | | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
1295 | 1379 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| |||
0 commit comments