jianguotian opened a new pull request, #11434:
URL: https://github.com/apache/paimon/pull/11434

   ### Purpose
   
   Short input tails currently lower `MosaicRecordsWriter`'s adaptive batch 
target even when memory is sufficient. After a one-row input, the next input 
starts with only two rows and has to grow again, causing unnecessary Arrow 
conversion/export and native write calls.
   
   Preserve the learned target when the successful slice was limited by the 
remaining input rows. Continue to apply the measured memory bound and 
configured batch-size cap. Initial sizing, gradual growth, allocation-failure 
retries and per-slice flushing remain unchanged.
   
   Only the existing Mosaic writer and its column-batch test change; no new 
API, configuration or dependency is required.
   
   ### Tests
   
   - A regression test reproduces the old tail-driven fragmentation and 
verifies batch sizes and output values after the fix.
   - Normal JDK 8 reactor checks and all 152 Mosaic tests pass, including 
memory limits, skewed values, allocator exhaustion, selections and native round 
trips:
     `mvn -pl paimon-mosaic -am -DfailIfNoTests=false -DwildcardSuites=none 
'-Dtest=Mosaic*Test' test`
   
   Paired local compaction measurements on ARM64 with native Mosaic 0.2.0, 
default batch settings and VIN bitmap enabled. Both variants use column 
execution; only the compiled Mosaic writer changes. Each variant has six 
measured runs across two JVMs, one warmup per JVM, in before/after/after/before 
order. Native call counts come from separate diagnostic runs.
   
   | Inputs | Native writes, before → after | Median time, before → after | 
Result |
   | --- | --- | --- | --- |
   | 24 × 150 rows (copies of one sample) | 56 → 27 | 9.973 s → 7.425 s | 25.6% 
less time |
   | Three distinct 600-row files | 8 → 8 | 2.764 s → 2.727 s | Essentially 
unchanged |
   | Distinct 600/600/69/600-row files | 11 → 9 | 3.137 s → 2.981 s | 5.0% less 
time |
   
   All 60 runs, including warmups and diagnostics, preserve full logical 
values/order, row counts and exact VIN bitmap positions. These are cached 
local-file measurements with 11,371 logical fields, not distributed production 
throughput. The 150-row case is a boundary regression fixture; it is not a 
representative customer-file distribution.
   
   The existing large-file fixture (seven distinct files, 66,658 rows, 8,700 
fields; JDK 8) remains essentially unchanged: median 13.329 s before vs 13.409 
s after across six measurements per variant. All 16 outputs are byte-identical 
to the previously fully verified canonical file, and their bitmap, statistics 
and sequence-number checks pass.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to