AynSiddiqui opened a new pull request, #1570:
URL: https://github.com/apache/arrow-go/pull/1570

   ### Rationale for this change
   
   Fixes #1557. Importing a C Data Map array whose keys or entries child has 
nulls panics in `array.MakeFromData`. On the record batch path, a checked 
allocator also reports leaked bytes.
   
   ### What changes are included in this PR?
   
   Before building the Map, the importer checks the null counts of the entries 
and keys children and returns `arrow.ErrInvalid` if either is nonzero. An 
unknown null count (-1) is computed from the validity bitmap using the child's 
offset, so valid children with an unknown count still import.
   
   ### Are these changes tested?
   
   Yes. `TestImportMapNullability` covers direct array, record batch, stream 
and nested (List of Map) imports, with nulls in keys or entries, known and 
unknown null counts, and sliced children. Each failure case checks that the 
producer's release callback runs once and that the checked allocator ends at 
zero; each one panics on main. The small C helpers only count release calls and 
build a single-array stream, because the Go export path validates the Map 
before exporting it. `go test -race -short` with `-tags assert,test` and `-tags 
assert,test,noasm` passes for `./arrow/cdata`. I couldn't run the `ccalloc` 
variant locally (no Arrow C++ install).
   
   ### Are there any user-facing changes?
   
   Importing a Map with null keys or entries now returns an error instead of 
panicking.
   


-- 
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]

Reply via email to