Repository navigation
Conversation
a1fa295 to
4d0fdfd
Compare
|
run benchmark variant_kernels |
|
🤖 Benchmark starting (GKE) | trigger Target: variant_kernels Sharding factor: 1 (1 workers). Comparing variant-views-4-shred (4d0fdfd) to 093ef04 (merge-base) diff Run configurationrun benchmark variant_kernels
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
alamb
left a comment
There was a problem hiding this comment.
Looks good an dmakes sense to me -- thank yoU @cetra3
Note that I think we could apply a similar optimization (copy the original bytes rather than decode/reencode in some other places too (maybe as a follow on PR)
arrow-rs/parquet-variant-compute/src/unshred_variant.rs
Lines 333 to 349 in 4d0fdfd
And
arrow-rs/parquet-variant-compute/src/unshred_variant.rs
Lines 366 to 387 in 4d0fdfd
| ))); | ||
| } | ||
| object_builder.insert_bytes(field_name, field_value); | ||
| object_builder.insert_encoded(object.field_id(i)?, object.field(i)?.bytes()?)?; |
There was a problem hiding this comment.
I think this is one key optimization -- just copy the original variant bytes rather than re-walking/re-encoding a parsed one 👍
|
🤖 Benchmark completed (GKE) | trigger Target: variant_kernels Comparing variant-views-4-shred (4d0fdfd) to 093ef04 (merge-base) diff Run configurationrun benchmark variant_kernels
shards: 1
DetailsPer-runner informationvariant_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-fytca8go-9faf2da9-wvqf Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench variant_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
d32659d to
76ad2d5
Compare
3934847 to
33730f9
Compare
`variant_get` reads each row of an unshredded column through `VariantView::get_path`. A row reads only the headers and field names along the path, and decodes only the value that it finds. Co-Authored-By: Claude Fable 5.2 <[email protected]>
33730f9 to
59a715c
Compare
…_path its own Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01USkuh43UDwSoij2az8NwbM
59a715c to
2304fc4
Compare
`VariantMetadataHeader` and `VariantListHeader` hold the header byte and decode it in their accessors, as `VariantObjectHeader` does. Every row of an unshredded column builds a metadata view, and every list row builds a list view, so both are copied often, and one byte is cheaper to build and copy than the decoded fields. `VariantMetadataHeader::try_new` keeps the version check, its only error. `VariantListHeader::new` is infallible, because every two-bit offset size is valid. `OffsetSizeBytes::try_new` lost its last callers and is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01USkuh43UDwSoij2az8NwbM
`shred_variant` and `unshred_variant` copy each leftover object field by its field id and encoded bytes, through the new `ObjectBuilder::insert_encoded` and `VariantView::bytes`. A leftover field is no longer decoded into a `Variant` and encoded again. Co-Authored-By: Claude Fable 5.2 <[email protected]>
2304fc4 to
e1c2ee8
Compare
Name the shredded object `object` and shadow it with its view, as `unshred_variant` does, take the suggested `insert_encoded` wording, and reword the `VariantView::bytes` summary. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01USkuh43UDwSoij2az8NwbM
|
run benchmark variant_kernels |
|
🤖 Benchmark starting (GKE) | trigger Target: variant_kernels Sharding factor: 1 (1 workers). Comparing variant-views-4-shred (866eee4) to 3f109cd (merge-base) diff Run configurationrun benchmark variant_kernels
shards: 1
Trigger commentResults will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: variant_kernels Comparing variant-views-4-shred (866eee4) to 3f109cd (merge-base) diff Run configurationrun benchmark variant_kernels
shards: 1
Trigger commentDetailsPer-runner informationvariant_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-c3wi9x9d-d6a7d411-pjgr Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench variant_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
Performance numbers look really good to me |
|
(this PR is still marked draft -- is it ready for review / merge?) |
Which issue does this PR close?
This PR is stacked on #12309 and #12310. Its own change is the commit "perf(variant): copy leftover object fields by field id when shredding". It is a draft until they merge.
Rationale for this change
When
shred_variantandunshred_variantcopy an object field that is not shredded, they decode it into aVariant, look its name up in the metadata dictionary to get the field id back, and encode the value again. The output uses the same metadata dictionary as the input, so the field id and the encoded bytes are already correct.What changes are included in this PR?
ObjectBuilder::insert_encodedadds a field by its field id and its encoded bytes.VariantView::bytesreturns the exact encoding of a value.shred_variantandunshred_variantcopy leftover object fields through them. They match field names as bytes against a sorted list of the shredded field names.Are these changes tested?
The existing shredding tests cover the changed code.
VariantView::byteshas tests for every primitive type, and for the fields of an object and the elements of a list, whose encodings must tile the value region of their parent.Benchmarks (local run, this PR against #12310, x86_64 Linux):
shred_variant_partial_object_8k_rowsshred_variant_unmatched_object_8k_rowsunshred_variant_listunshred_variant_list_of_objectsunshred_variant_nested_fallbackunshred_variant_objectunshred_variant_partial_objectunshred_variant_partial_object_unsorted_metadataunshred_variant_primitivevariant_get_unshredded_object_path_262k_rowsvariant_get_list_index_unshreddedvariant_get_utf8_from_unshredded_stringvariant_get_binary_from_stringAre there any user-facing changes?
New public API in
parquet-variant:ObjectBuilder::insert_encodedandVariantView::bytes.On malformed variant bytes,
shred_variantand the leftover copy inunshred_variantreturn an error. Before, these paths could panic.🤖 Generated with Claude Code