dartkron opened a new pull request, #50607:
URL: https://github.com/apache/arrow/pull/50607
### Rationale for this change
`ViewDataImpl` skipped input layout entries marked `ALWAYS_NULL`. A nested
`NullType` has no physical buffer, but its `ArrayData` still carries the
length
and offset needed for the output. Losing this metadata could make a cast
to the
same nested type produce an invalid child array.
Fixes #43838.
### What changes are included in this PR?
Preserve length and offset when matching an input `NullType` with an output
`NullType`, while retaining the previous behavior for other `ALWAYS_NULL`
layouts, including union and run-end encoded types. Add a regression test
for
a sliced nested `NullArray`.
### Are these changes tested?
Yes. The regression test and all 51 CTest targets enabled in the local C++
build pass in an Ubuntu 24.04 container.
### Are there any user-facing changes?
Yes. Casts containing nested `NullType` fields no longer produce invalid
child
arrays. There are no public API changes.
### AI assistance
AI assistance was used during investigation, implementation, and review. I
reviewed the final changes and verified them with the tests described
above.
**This PR contains a "Critical Fix".** The previous behavior could produce
an
invalid array from valid input.
--
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]