fallintoplace opened a new pull request, #957: URL: https://github.com/apache/arrow-go/pull/957
### Rationale for this change `MapBuilder` currently sizes its child struct from the key builder without checking the item builder. Unequal key and item counts can therefore create malformed map data or defer the failure until later array access. ### What changes are included in this PR? - Reject unequal key and item builder lengths before array construction resets the builders. - Reject a child struct length that exceeds the entry count. - Validate the offset count and any explicitly supplied final offset. - Return invariant failures as panics wrapping `arrow.ErrInvalid`, consistent with the existing builder API. ### Are these changes tested? Yes. Tests cover extra keys, extra items, an oversized child struct, and a final offset that exceeds the available entries. The array subtree tests, focused race tests, 10 repeated package runs, and linux/amd64 compilation pass. ### Are there any user-facing changes? Malformed map builder state now fails immediately with a descriptive invalid-data panic instead of constructing an inconsistent array or panicking during later access. Valid builder usage is unchanged. -- 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]
