Repository navigation
Conversation
… a Field NullableStructWriter/SingleStructWriter threw "Unknown type: NULL" when the struct field had a Null-typed child, which broke e.g. StructVector#getTransferPair(Field, ...). Add the NullVector child instead.
ump45nose
requested review from
jbonofre,
laurentgo,
lidavidm and
wgtmac
as code owners
October 21, 2026 01:06
|
Thank you for opening a pull request! Please label the PR with one or more of:
Also, add the 'breaking-change' label if appropriate. See CONTRIBUTING.md for details. |
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
NullableStructWriter/SingleStructWriter(generated fromStructWriters.java) walk the struct field's children in their constructor and create a child vector for each one. There was nocase NULL, so a struct whose field has aNull-typed child threwUnsupportedOperationException: Unknown type: NULL. BecauseStructVectorbuilds its writer as soon as it is constructed, this brokenew StructVector(field, ...)and anything that goes through it, such asStructVector#getTransferPair(Field, BufferAllocator)from the issue.There is no writer for the Null type, so the new case only adds the
NullVectorchild to the container (with the child's nullability). The resulting vector's field now matches the input field, and the other children's writers keep working as before.Tests added to
TestStructVector:testStructVectorTransferPairWithNullType: the reproducer from the issue, plus atransfer()that checks the value count, struct validity and theNullVectorchild.testStructVectorFromFieldWithNullChild: builds aStructVectorstraight from aFieldwith a Null child and an Int child, then writes through the struct writer.Both fail on
mainwithUnknown type: NULLand pass with this change. I also ranTestStructVector,TestComplexWriter,TestListVector,TestMapVector,TestUnionVector,TestDenseUnionVector,TestComplexCopier,TestPromotableWriterandTestSplitAndTransfer(all pass, both the default and netty runs), andmvn -pl vector spotless:check.AI assistance disclosure: this change, its tests and this description were prepared with the help of an AI coding assistant. The tests listed above were run locally against this branch.
Closes #830.