Commit d6016ae
Speed up dictionary-column Arrow export; clearer mode='a' error
iter_arrow_batches() recomputed the full live-row-position array from
scratch on every batch, for every dictionary column, instead of once
per export call — an O(n_rows) scan repeated O(n_rows / batch_size)
times. Hoisted the computation out of the loop (6-14x faster export
for dictionary columns on a 1M-row benchmark). Added a regression test
covering the fix across a batch boundary with deleted rows.
Also raise a clear FileNotFoundError when mode='a' is used to open a
CTable that doesn't exist yet, instead of falling through to create
one silently (both the regular constructor and the from_arrow/import
storage path).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 4dcbf51 commit d6016ae
2 files changed
Lines changed: 57 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3941 | 3941 | | |
3942 | 3942 | | |
3943 | 3943 | | |
| 3944 | + | |
| 3945 | + | |
| 3946 | + | |
| 3947 | + | |
| 3948 | + | |
3944 | 3949 | | |
3945 | 3950 | | |
3946 | 3951 | | |
| |||
6714 | 6719 | | |
6715 | 6720 | | |
6716 | 6721 | | |
| 6722 | + | |
| 6723 | + | |
| 6724 | + | |
| 6725 | + | |
| 6726 | + | |
| 6727 | + | |
| 6728 | + | |
| 6729 | + | |
| 6730 | + | |
6717 | 6731 | | |
6718 | 6732 | | |
6719 | 6733 | | |
| |||
6756 | 6770 | | |
6757 | 6771 | | |
6758 | 6772 | | |
6759 | | - | |
6760 | | - | |
6761 | | - | |
6762 | | - | |
| 6773 | + | |
| 6774 | + | |
| 6775 | + | |
6763 | 6776 | | |
6764 | 6777 | | |
6765 | 6778 | | |
| |||
7235 | 7248 | | |
7236 | 7249 | | |
7237 | 7250 | | |
| 7251 | + | |
| 7252 | + | |
| 7253 | + | |
| 7254 | + | |
| 7255 | + | |
7238 | 7256 | | |
7239 | 7257 | | |
7240 | 7258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
457 | 492 | | |
458 | 493 | | |
459 | 494 | | |
| |||
0 commit comments