fix(arrow): support zero-length fixed-size lists - #1308
Open
jakthom wants to merge 1 commit into
Open
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
DataFusion can return
FixedSizeList(0, Null)for an empty list. Arrow Go currently rejects the C data schema+w:0, and its fixed-size list constructors also panic for size zero. This prevents importing results such as:A zero-size list has no child values, but its parent array still has rows and a validity bitmap that distinguishes empty lists from null lists. This fixes the two failing cases in DataFusion's
arrow_typeof.slt.What changes are included in this PR?
Are these changes tested?
Local verification on macOS ARM64 with Go 1.25.2:
pre-commit run --all-files --show-diff-on-failureci/scripts/build.sh "$PWD"ci/scripts/test.sh "$PWD"(race detector,assert,test, andnoasmvariants)go test -race -short -tags=assert,test ./internal/...The datafusion-go SQLLogicTest corpus also passes 24,958/24,958 assertions across 365 executable SQL files on macOS when an isolated Go module file replaces Arrow Go with this checkout. That includes all 62 records in
arrow_typeof.slt; the released Arrow Go dependency fails two of those records. This downstream run used DataFusion 55.0.0 and datafusion-go commit8fbd0218b6c5f3d9d64ec798ae466f66725be325.Are there any user-facing changes?
Zero-size fixed-size lists can now be constructed, validated, and imported through the C data interface. Existing constructor and import checks for negative sizes are preserved.