Repository navigation
[mosaic] Avoid shrinking vectorized write batches after short inputs - #11434
Open
jianguotian wants to merge 1 commit into
Open
jianguotian wants to merge 1 commit into
jianguotian wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Compaction performance
Measured on ARM64 with the released Mosaic 0.3.0 JNI library, cached local files, default batch settings and the VIN bitmap enabled. Both versions used vectorized execution and differed only in the writer change. Times are medians of six measured runs per version across two JVMs, with one warmup per JVM. Native writes were counted separately.
The three short-file fixtures had 11,371 logical fields. Every run preserved all values, row order and exact VIN bitmap positions. The 24 × 150-row fixture exercises the short-tail boundary. On the 8,700-field large-file fixture, the timing ranges overlapped. Full decoding matched the input, and all 16 output files had identical SHA-256 hashes.