fix(arrow-cast): respect sliced list offsets in fixed-size list casts - #11065
Open
CodingCossack wants to merge 1 commit into
Open
fix(arrow-cast): respect sliced list offsets in fixed-size list casts#11065CodingCossack wants to merge 1 commit into
CodingCossack wants to merge 1 commit into
Conversation
Generated-by: OpenAI Codex
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.
Which issue does this PR close?
Closes #10975.
Rationale for this change
Slicing a ListArray or LargeListArray retains offsets into the original
child array. Casting the slice to FixedSizeList currently reads from child
position zero on the fast path and when copying the first pending run on
the padding path. This can return excluded values or overfill the padded
output.
What changes are included in this PR?
Start child selection and the first pending copy at the first retained
offset. Replace the numeric cursor sentinel and first-row special case
with Option, distinguishing no replacement from a valid source
position, including for empty rows.
Preserve the existing safe/strict length handling and perform child
conversion after selecting or padding the retained rows.
Are these changes tested?
Three regression tests cover both list offset widths, fast and padding
paths, non-zero offsets, excluded values during child conversion, nulls,
safe/strict behaviour, empty slices and zero-width output.
Local validation executed by Codex:
git diff --check passed.
Are there any user-facing changes?
Affected sliced List and LargeList casts now select the correct child
values and avoid padding-path overfill. No public API changes.
AI assistance
OpenAI Codex generated the implementation and regression tests and ran
the local validation. ChatGPT assisted with an independent static review
and this PR description.