hcrosse opened a new pull request, #1735: URL: https://github.com/apache/arrow-go/pull/1735
### Rationale for this change In `arrow/scalar`, `fromListScalar` reads map entries from raw offsets instead of the map array's logical offset and length, so converting a sliced `Map` array reads the wrong entries or panics with an out-of-range slice index. It also reads keys and items without applying the entries struct's offset, does not skip null map slots or null item values, panics on non-binary map children, and returns strings aliasing Arrow buffers. ### What changes are included in this PR? - Iterate over the map array's logical length with `ValueOffsets` and skip null map entries so they stay nil in the resulting metadata slice. - Read keys and items from the child entries struct fields using checked assertions, returning an invalid error for unsupported entry, key, or item types. - Check item validity before reading values and copy key and value bytes into owned Go strings instead of aliasing Arrow buffers. ### Are these changes tested? Yes. I added checked-allocator tests covering sliced maps, null map entries, non-zero child struct offsets, masked null item values, and unsupported map key or item types. ### Are there any user-facing changes? `FromScalar` now handles sliced maps, child struct offsets, and null map or item slots without panicking or reading masked data, and returns an invalid error for non-binary map keys or items. -- 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]
