Commit 042c123
Single-pass symbol-dict append; test window remap
PersistedSymbolDict.appendSymbols encoded the mapped chunk in two
passes over the id range: a first loop called Utf8s.utf8Bytes on every
symbol just to size the header varint and the mmap reserve, then a
second loop re-walked each symbol's UTF-8 length to write it. It now
stages the entry region in the scratch buffer with a single walk per
symbol and bulk-copies it into the append window after the header,
dropping the redundant walk. The chunk it writes is byte-identical, so
the exact-file-size "one chunk, one CRC" test still holds. A direct
in-window encode cannot avoid the double walk: the back-to-back chunk
format leaves no room to reserve and back-fill the header in place.
The path is cold -- only a retry after a failed publish re-encodes
from the dictionary; the steady state persists a frame's pre-encoded
bytes through appendRawEntries.
Add testMappedAppendSpansMultipleWindowsAndRecoversDenseIds: it appends
a dictionary larger than one 4 MiB append window, asserts the window
remaps (appendMapGrowthCount >= 2) without a positioned write, then
reopens and checks every id recovers to its own symbol across the
boundary. This exercises the ensureAppendMap remap arithmetic and the
single-pass encode as chunks straddle the boundary, both of which the
single-window happy path left untested.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 16be764 commit 042c123
2 files changed
Lines changed: 77 additions & 22 deletions
File tree
- core/src
- main/java/io/questdb/client/cutlass/qwp/client/sf/cursor
- test/java/io/questdb/client/test/cutlass/qwp/client/sf/cursor
Lines changed: 29 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
423 | 430 | | |
424 | 431 | | |
425 | 432 | | |
| |||
432 | 439 | | |
433 | 440 | | |
434 | 441 | | |
435 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
436 | 448 | | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
443 | 456 | | |
| 457 | + | |
444 | 458 | | |
445 | | - | |
446 | 459 | | |
447 | 460 | | |
448 | 461 | | |
449 | 462 | | |
450 | 463 | | |
451 | 464 | | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
461 | 468 | | |
462 | 469 | | |
463 | 470 | | |
| |||
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| 455 | + | |
| 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 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
455 | 503 | | |
456 | 504 | | |
457 | 505 | | |
| |||
0 commit comments