GH-43838: [Python][C++] Preserve nested NullType metadata in array views#50607
Open
dartkron wants to merge 1 commit into
Open
GH-43838: [Python][C++] Preserve nested NullType metadata in array views#50607dartkron wants to merge 1 commit into
dartkron wants to merge 1 commit into
Conversation
|
|
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
ViewDataImplskipped input layout entries markedALWAYS_NULL. A nestedNullTypehas no physical buffer, but itsArrayDatastill carries the lengthand 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
NullTypewith an outputNullType, while retaining the previous behavior for otherALWAYS_NULLlayouts, 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
NullTypefields no longer produce invalid childarrays. 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.