Commit e215851
authored
refactor: unify flush and compaction to always use FlatSource (#7799)
* feat: support write flat as primary key format
Signed-off-by: evenyag <realevenyag@gmail.com>
* feat: migrate flush to always use FlatSource
Add FormatType propagation in SstWriteRequest and use it to choose
Flat vs PrimaryKey write paths (write_all_flat vs
write_all_flat_as_primary_key) in AccessLayer and WriteCache. Make
compactor and flush derive the sst_write_format from region options or
engine config. Simplify flush logic and remove the old memtable_source
helper. Update tests to set default sst_write_format.
Signed-off-by: evenyag <realevenyag@gmail.com>
* refactor: compaction use flat source
Signed-off-by: evenyag <realevenyag@gmail.com>
* refactor: read parquet sequentially as flat batches
Signed-off-by: evenyag <realevenyag@gmail.com>
* refactor: remove new_batch_with_binary in favor of new_record_batch_with_binary
Replace PrimaryKeyWriteFormat with FlatWriteFormat in test_read_large_binary
test and use new_record_batch_with_binary directly, removing the now-unused
new_batch_with_binary function and its BinaryArray import.
Signed-off-by: evenyag <realevenyag@gmail.com>
* test: add tests for PrimaryKeyWriteFormat::convert_flat_batch
Signed-off-by: evenyag <realevenyag@gmail.com>
* refactor: remove Either from SstWriteRequest
Signed-off-by: evenyag <realevenyag@gmail.com>
* fix: handle index build mode
Signed-off-by: evenyag <realevenyag@gmail.com>
* fix: consider sparse encoding and last non null in flush
Signed-off-by: evenyag <realevenyag@gmail.com>
* test: add unit tests for field_column_start edge cases
Signed-off-by: evenyag <realevenyag@gmail.com>
---------
Signed-off-by: evenyag <realevenyag@gmail.com>1 parent 74ff5c3 commit e215851
File tree
17 files changed
+656
-892
lines changed- src
- cmd/src/datanode
- mito2/src
- cache
- compaction
- memtable
- read
- sst
- parquet
- test_util
17 files changed
+656
-892
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| 214 | + | |
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
| |||
231 | 233 | | |
232 | 234 | | |
233 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
234 | 240 | | |
235 | 241 | | |
236 | 242 | | |
| |||
241 | 247 | | |
242 | 248 | | |
243 | 249 | | |
244 | | - | |
| 250 | + | |
245 | 251 | | |
246 | 252 | | |
247 | 253 | | |
| 254 | + | |
248 | 255 | | |
249 | 256 | | |
250 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | | - | |
| 39 | + | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| |||
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
50 | | - | |
| 49 | + | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
| |||
391 | 390 | | |
392 | 391 | | |
393 | 392 | | |
394 | | - | |
395 | | - | |
| 393 | + | |
| 394 | + | |
396 | 395 | | |
397 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
398 | 401 | | |
399 | 402 | | |
400 | | - | |
| 403 | + | |
401 | 404 | | |
402 | | - | |
| 405 | + | |
403 | 406 | | |
404 | 407 | | |
405 | 408 | | |
| |||
520 | 523 | | |
521 | 524 | | |
522 | 525 | | |
523 | | - | |
| 526 | + | |
524 | 527 | | |
525 | 528 | | |
526 | 529 | | |
527 | 530 | | |
| 531 | + | |
528 | 532 | | |
529 | 533 | | |
530 | 534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
248 | | - | |
| 247 | + | |
| 248 | + | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
251 | 255 | | |
252 | 256 | | |
253 | | - | |
| 257 | + | |
254 | 258 | | |
255 | | - | |
| 259 | + | |
256 | 260 | | |
257 | 261 | | |
258 | 262 | | |
| |||
509 | 513 | | |
510 | 514 | | |
511 | 515 | | |
512 | | - | |
| 516 | + | |
513 | 517 | | |
514 | 518 | | |
515 | 519 | | |
516 | 520 | | |
517 | | - | |
| 521 | + | |
| 522 | + | |
518 | 523 | | |
519 | 524 | | |
520 | 525 | | |
| |||
532 | 537 | | |
533 | 538 | | |
534 | 539 | | |
535 | | - | |
| 540 | + | |
536 | 541 | | |
537 | 542 | | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
542 | 547 | | |
543 | 548 | | |
544 | 549 | | |
545 | 550 | | |
546 | 551 | | |
547 | | - | |
| 552 | + | |
548 | 553 | | |
549 | 554 | | |
| 555 | + | |
550 | 556 | | |
551 | 557 | | |
552 | 558 | | |
| |||
636 | 642 | | |
637 | 643 | | |
638 | 644 | | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
643 | 649 | | |
644 | 650 | | |
645 | 651 | | |
646 | 652 | | |
647 | 653 | | |
648 | 654 | | |
649 | | - | |
| 655 | + | |
650 | 656 | | |
651 | 657 | | |
| 658 | + | |
652 | 659 | | |
653 | 660 | | |
654 | 661 | | |
| |||
715 | 722 | | |
716 | 723 | | |
717 | 724 | | |
718 | | - | |
| 725 | + | |
719 | 726 | | |
720 | | - | |
| 727 | + | |
721 | 728 | | |
722 | 729 | | |
723 | 730 | | |
| |||
730 | 737 | | |
731 | 738 | | |
732 | 739 | | |
733 | | - | |
| 740 | + | |
734 | 741 | | |
735 | 742 | | |
| 743 | + | |
736 | 744 | | |
737 | 745 | | |
738 | 746 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
831 | | - | |
| 831 | + | |
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
| |||
841 | 841 | | |
842 | 842 | | |
843 | 843 | | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | 844 | | |
852 | 845 | | |
853 | | - | |
| 846 | + | |
854 | 847 | | |
855 | 848 | | |
856 | 849 | | |
857 | 850 | | |
858 | 851 | | |
859 | 852 | | |
860 | | - | |
861 | | - | |
| 853 | + | |
| 854 | + | |
862 | 855 | | |
863 | 856 | | |
864 | 857 | | |
| |||
868 | 861 | | |
869 | 862 | | |
870 | 863 | | |
871 | | - | |
| 864 | + | |
872 | 865 | | |
873 | 866 | | |
874 | 867 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
| 359 | + | |
| 360 | + | |
366 | 361 | | |
367 | 362 | | |
368 | 363 | | |
| |||
375 | 370 | | |
376 | 371 | | |
377 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
0 commit comments