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

   ### Rationale for this change
   
   `Validate` and `ValidateFull` reject valid extension arrays over null, union 
and dictionary storage, although the storage arrays pass.
   
   ### What changes are included in this PR?
   
   The null count rule, the union buffer offset and the dictionary checks now 
use the extension's storage type. A small `storageType` helper does the 
unwrapping, and the existing check for bufferless run-end encoded storage uses 
it too. Arrays of other types keep their own type. Arrow C++ also [validates 
extension arrays through their storage 
type](https://github.com/apache/arrow/blob/1ebb9379b2f635755e773b79e88cb99852c70455/cpp/src/arrow/array/validate.cc#L456-L459).
   
   One invalid case is now rejected. An extension array over null storage that 
claims a null count of 0 fails `ValidateFull`, as a plain `null` array already 
does. Dictionary index bounds are still checked only by `ValidateFull`.
   
   ### Are these changes tested?
   
   Yes. I extended `TestMakeArrayOfNullNestedNull` with extension types over 
null, sparse union, dense union and dictionary storage. Each row runs at 
lengths 0 and 3, checks the type and null count, and calls `ValidateFull` with 
a checked allocator. The existing 
`TestRunEndEncodedValidateConstructedArrays/extension` covers the run-end 
encoded check that now uses the helper.
   
   All new rows fail on main and pass with this change. The issue's 
reproduction prints `<nil>` for all four checks with this change. With 
`array.MakeFromData`, a valid extension array over dictionary storage passes 
both checks, and an index of 5 into two values fails `ValidateFull`.
   
   On macOS arm64 with Go 1.26.10, `go test ./arrow/...` passed with 
arrow-testing and parquet-testing checked out. `go test -race -tags 
assert,test` and `go vet` on `arrow/array/...`, `arrow/extensions/...` and 
`arrow/scalar/...`, `golangci-lint` 2.13.2 in `arrow`, `parquet` and 
`internal`, and the Release Audit Tool also passed.
   
   ### Are there any user-facing changes?
   
   Yes. Valid extension arrays over these storage types pass validation, and a 
wrong null count on null storage is rejected. There is no API change.
   
   Closes https://github.com/apache/arrow-go/issues/1483.
   


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