Repository navigation
[Variant] Add fallible builder value append API - #11401
Closed
osipovartem wants to merge 1 commit into
Closed
osipovartem wants to merge 1 commit into
osipovartem wants to merge 1 commit into
Conversation
Contributor
|
Contributor
Author
osipovartem
added a commit
to Embucket/arrow-rs
that referenced
this pull request
Oct 23, 2026
) ### Why `ObjectBuilder` updates its field-offset map before appending a value. With duplicate-key validation enabled, rejecting a duplicate can leave the map changed. With validation disabled, a failed fallible overwrite truncates bytes but leaves the previous offset unrestored. Continuing to build the object can then produce an invalid value. ### Change Reject validated duplicates before mutation and restore the previous offset when a permitted overwrite fails. The default non-validating path keeps its existing `fields.insert` fast path. Add regression tests that continue building after each error. This is independent of the fallible trait API in apache#11106; it is the unique correction extracted from superseded apache#11401. ### Validation - `cargo +1.98.1 test -p parquet-variant --lib`: 176 passed. - Formatting and `cargo +1.98.1 clippy -p parquet-variant --lib` pass (installed 1.98.1 reports the repo's newer lint as unknown). - Focused short Criterion runs showed no repeatable regression, but WSL measurements were noisy; the default insert path is unchanged. - Independent read-only review covered correctness, regressions, performance, API compatibility, and tests; approved with no blockers.
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.
Split from #11177. This adds
VariantBuilderExt::try_append_valueand fallible implementations for variant, list, object-field, array and top-level row builders. It also preserves object field offsets if a failed append overwrites an existing key. No JSON parsing or decimal conversion changes are included.Validation: 176
parquet-variantand 371parquet-variant-computelibrary tests pass;cargo fmt --checkpasses.cargo clippy --libpasses with warnings from the installed Rust 1.98.1 toolchain (the repo pins 1.99).An independent read-only review covered correctness, regressions, performance, API compatibility, and tests and explicitly approved this split.