[rust] Wire batch statistics into the log batch write and read paths - #4074
Open
leekeiabstraction wants to merge 1 commit into
Open
[rust] Wire batch statistics into the log batch write and read paths#4074leekeiabstraction wants to merge 1 commit into
leekeiabstraction wants to merge 1 commit into
Conversation
leekeiabstraction
force-pushed
the
rust-batch-stats-wiring
branch
4 times, most recently
from
August 22, 2026 22:22
fa1d999 to
64a77dd
Compare
Tables with 'table.statistics.columns' set now produce V1 batches carrying serialized statistics, matching Java's MemoryLogRecordsArrowBuilder. The reader now locates the records data per the batch's magic, fixing the misparsing of V1 batches that Java clients and the server's projection path already produce.
leekeiabstraction
force-pushed
the
rust-batch-stats-wiring
branch
from
August 22, 2026 22:26
64a77dd to
6b7cd0a
Compare
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.
Summary
table.statistics.columnsset, the accumulator hands the resolved column mapping to the Arrow builder, which emits a V1 batch with the serialized statistics placed between the header and the records data, mirroring Java'sMemoryLogRecordsArrowBuilder. A serialization failure degrades to an empty statistics section, and the batch size estimate reserves room for the statistics.DefaultLogRecordBatch.recordsDataOffset, and every decode entry point rejects unknown magic versions before the empty-batch short-circuit. This fixes the Rust reader misparsing V1 batches that Java clients and the server's projection path already produce.Test Plan
fluss-common/src/test/resources/encoding/statistics_block.hex, generated and asserted by a new Java test) locks the Rust statistics block byte-for-byte against Java'sLogRecordBatchStatisticsWriteracross all supported types, nulls, both decimal widths, and both timestamp precisions. CHAR is excluded because Java's collector records no CHAR bounds.cargo test -p fluss-rs --libpasses 700 tests; clippy and fmt are clean.🤖 AI-assisted changes - reviewed by human developer