Repository navigation
[Variant] Restore object field offsets after failed append - #11403
Conversation
|
Hi @osipovartem, I'd like to have a bench for this change as well. It seems like we already have some benchmarks that can partially cover the changed behavior, but they not targeted enough and require a Validation toggle arrow-rs/parquet-variant/benches/variant_builder.rs Lines 94 to 112 in 9c07b17 or time smth else entirely arrow-rs/parquet-variant/benches/variant_builder.rs Lines 390 to 400 in 9c07b17 I think adding a small bench timing the ObjectBuilder::insert with validation on and off should do |
|
Added the requested |
|
@osipovartem sorry I didn't make myself clear. Can we add the benchmark in a separate PR so we the bot can run it? The bench looks good |
This reverts commit d3b825e.
|
Thanks for clarifying. I moved the benchmark into a standalone PR: #11461. I removed it from this PR so the benchmark can land and be measured independently first. |
|
@osipovartem can you merge with main again, I'll run the bench |
…pache#11461) Adds a focused Criterion benchmark for inserting 128 pre-generated unique fields into a Variant object, in both validated and unvalidated modes. This benchmark-only PR establishes a baseline for the behavior change in apache#11403, as requested in review. Validation: the benchmark compiled on current Apache main; both cases ran in a short local smoke test. Independent read-only review found no blocking issues.
|
run benchmark variant_builder |
|
🤖 Benchmark starting (GKE) | trigger Target: variant_builder Sharding factor: 1 (1 workers). Comparing upstream-variant-object-rollback (effbfc6) to 4d8b332 (merge-base) diff Run configurationrun benchmark variant_builder
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: variant_builder Comparing upstream-variant-object-rollback (effbfc6) to 4d8b332 (merge-base) diff Run configurationrun benchmark variant_builder
shards: 1
DetailsPer-runner informationvariant_builder — shard 1/1Node: gk3-benchmark-cluster-nap-hzcqstew-0cdd7fda-f7bv Instance: c4a-highcpu-48 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench variant_builderCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
run benchmark variant_builder |
|
🤖 Benchmark starting (GKE) | trigger Target: variant_builder Sharding factor: 1 (1 workers). Comparing upstream-variant-object-rollback (effbfc6) to 4d8b332 (merge-base) diff Run configurationrun benchmark variant_builder
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: variant_builder Comparing upstream-variant-object-rollback (effbfc6) to 4d8b332 (merge-base) diff Run configurationrun benchmark variant_builder
shards: 1
DetailsPer-runner informationvariant_builder — shard 1/1Node: gk3-benchmark-cluster-nap-orq9b72x-d7b0b158-fnjb Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench variant_builderCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
cakeni
left a comment
There was a problem hiding this comment.
Looks good to me. I also checked dropping an unfinished overwrite: the previous field survives, and a completed overwrite still replaces it.
|
Thanks again @osipovartem @cakeni |
Why
ObjectBuilderupdates 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.insertfast path. Add regression tests that continue building after each error. This is independent of the fallible trait API in #11106; it is the unique correction extracted from superseded #11401.Validation
cargo +1.98.1 test -p parquet-variant --lib: 176 passed.cargo +1.98.1 clippy -p parquet-variant --libpass (installed 1.98.1 reports the repo's newer lint as unknown).