cakeni opened a new pull request, #11537: URL: https://github.com/apache/arrow-rs/pull/11537
# Which issue does this PR close? Closes #10620. # Rationale for this change `VariantArray::try_value` returns a borrowed Variant, so it cannot represent a reconstructed shredded object or list without external storage. Callers currently need to unshred an array before accessing such a value. # What changes are included in this PR? Add `try_value_with_buffer(index, &mut Vec<u8>)`. It reconstructs only the requested composite row using the existing unshredding kernel and returns a Variant borrowing the array's metadata and the caller-owned value buffer. Primitive and residual values use the existing borrowed path. This provides storage for composite values while preserving existing accessor and iterator signatures; repeated bulk access should still use `unshred_variant` once. # Are these changes tested? Regression tests cover fully and partially shredded nested objects, all four supported list layouts, sliced arrays, missing and explicit-null values, buffer reuse, primitive borrowing, SQL-null rows, bounds, conflicting fields, and malformed metadata. A two-row test verifies that invalid metadata in another row does not prevent reading the selected row. A runnable API example documents the buffer lifetime. # Are there any significant user-facing changes? A new additive accessor supports composite values. Existing `try_value` remains the zero-allocation borrowed accessor and continues to reject composite typed values. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
