GH-1194: Preserve empty list offset buffers - #1229
Open
prashanthbdremio wants to merge 1 commit into
Open
Conversation
prashanthbdremio
requested review from
jbonofre,
laurentgo,
lidavidm and
wgtmac
as code owners
July 15, 2026 02:03
This comment has been minimized.
This comment has been minimized.
Author
|
Could a maintainer please add the |
Author
|
could you please take a look at it? thanks! |
| ArrowBuf oldOffsetBuffer = offsetBuffer; | ||
| offsetBuffer = allocateOffsetBuffer(requiredCapacity); | ||
| offsetBuffer.setBytes( | ||
| 0, oldOffsetBuffer, 0, Math.min(oldOffsetBuffer.capacity(), requiredCapacity)); |
There was a problem hiding this comment.
If requiredCapacity exceeds oldOffsetBuffer.capacity(), the remaining offset entries cannot be left uninitialized or zeroed — per the Arrow spec the offset buffer must be monotonically non-decreasing, so unfilled entries must be set to the last copied offset value to represent empty lists at those positions.
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.
What's Changed
Preserve the required one-entry offset buffer for empty
ListVectorandLargeListVectorinstances when setting value count and when splitting/transferring zero values. This keeps empty list vectors aligned with the Arrow offset-buffer invariant and avoids exposing buffers whose writer index exceeds capacity.Adds regression coverage for allocated, unallocated, split-and-transfer, and nested empty list vectors.
Closes #1194.
Tests:
mvn -pl vector -am -P=-error-prone -Dmaven.gitcommitid.skip=true -Dsurefire.failIfNoSpecifiedTests=false -Dtest=TestSplitAndTransfer,TestListVector,TestLargeListVector testmvn -P=-error-prone -Dmaven.gitcommitid.skip=true test