Commit f3ea766
[ASTERIXDB-3760][RT][STO] Handlers of vtree build on dimension mismatch
- user model changes: yes
- storage format changes: no
- interface changes: yes
Details:
By design, a vector index builds only over the embeddings whose
dimension matches the DDL and skips the rest, so a build is implicitly
partial. Each stage applied that rule on its own, which left the runtime
exception handling tangled: before this change, when no vector matched,
CREATE INDEX reported success while the bulk load dropped every record
and ANN queries on the finished index returned no rows; when only some
matched, training ran on vectors the index would never hold, one could
become a centroid, their components shaped the quantization constants,
and a vector longer than the declared dimension threw
ArrayIndexOutOfBoundsException in the distance loop.
Fix: apply the rule at every stage that consumes a sampled vector, and
reject a build that would leave a partition with nothing to index. The
rejection is raised in the first job, before any training work, and
names both the declared and the observed dimension.
- Training: test the dimension wherever a sampled vector is consumed,
and seed k-means from the first indexable one.
- Quantization: skip non-indexable vectors so the constants describe the
vectors the index will actually hold, and reject a partition whose
whole sample is non-indexable.
- Reporting: the static-structure creator no longer builds after an
upstream failure, which replaced the real error with "no training
vectors were found"; the empty quantization payload now names its
likely causes instead of a byte count.
- Metadata: drop the 384 fallback for a missing `dimension`.
- Storage: bind metaFrame in end(), where takeBlock needs it, so an
empty load works. takeBlock reads getMaxPage() without binding the
frame, unlike takePage.
Tests: operator coverage that off-dimension vectors do not shape the
centroids or the constants, for the partial and empty cases, and a
runtimets golden for the DDL error.
Ext-ref: MB-73219
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Change-Id: I44e13a38e10e09d0c439063582b2747942476f26
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21535
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ian Maxon <imaxon@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>1 parent 28e3dcf commit f3ea766
15 files changed
Lines changed: 406 additions & 20 deletions
File tree
- asterixdb
- asterix-app/src/test/resources/runtimets/queries_sqlpp/vector
- create-index-vtree-dimension-mismatch
- asterix-metadata/src/main/java/org/apache/asterix/metadata/utils
- asterix-runtime/src
- main/java/org/apache/asterix/runtime/operators
- test/java/org/apache/asterix/runtime/operators
- hyracks-fullstack/hyracks
- hyracks-storage-am-lsm-vtree/src/main/java/org/apache/hyracks/storage/am/lsm/vector/dataflow
- hyracks-storage-am-vtree/src/main/java/org/apache/hyracks/storage/am/vector/impls
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
72 | 85 | | |
73 | 86 | | |
74 | 87 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
680 | | - | |
| 680 | + | |
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| |||
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
96 | 97 | | |
97 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
| |||
Lines changed: 69 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
181 | 190 | | |
182 | 191 | | |
183 | 192 | | |
| |||
332 | 341 | | |
333 | 342 | | |
334 | 343 | | |
335 | | - | |
| 344 | + | |
336 | 345 | | |
337 | 346 | | |
338 | 347 | | |
| |||
395 | 404 | | |
396 | 405 | | |
397 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
398 | 413 | | |
399 | 414 | | |
400 | 415 | | |
| |||
432 | 447 | | |
433 | 448 | | |
434 | 449 | | |
435 | | - | |
436 | | - | |
| 450 | + | |
| 451 | + | |
437 | 452 | | |
438 | 453 | | |
| 454 | + | |
439 | 455 | | |
440 | 456 | | |
441 | 457 | | |
| |||
478 | 494 | | |
479 | 495 | | |
480 | 496 | | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
481 | 501 | | |
482 | 502 | | |
483 | 503 | | |
| |||
536 | 556 | | |
537 | 557 | | |
538 | 558 | | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
539 | 563 | | |
540 | 564 | | |
541 | 565 | | |
| |||
623 | 647 | | |
624 | 648 | | |
625 | 649 | | |
626 | | - | |
| 650 | + | |
| 651 | + | |
627 | 652 | | |
628 | 653 | | |
629 | 654 | | |
| |||
686 | 711 | | |
687 | 712 | | |
688 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
689 | 718 | | |
690 | 719 | | |
691 | 720 | | |
| |||
732 | 761 | | |
733 | 762 | | |
734 | 763 | | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
735 | 768 | | |
736 | 769 | | |
737 | 770 | | |
| |||
1012 | 1045 | | |
1013 | 1046 | | |
1014 | 1047 | | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
1015 | 1080 | | |
1016 | 1081 | | |
1017 | 1082 | | |
| |||
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
148 | 152 | | |
149 | 153 | | |
150 | 154 | | |
| |||
250 | 254 | | |
251 | 255 | | |
252 | 256 | | |
253 | | - | |
| 257 | + | |
254 | 258 | | |
255 | 259 | | |
256 | 260 | | |
| |||
440 | 444 | | |
441 | 445 | | |
442 | 446 | | |
443 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
444 | 452 | | |
445 | 453 | | |
446 | 454 | | |
| |||
0 commit comments