Repository navigation
GH-1471: Pair dense union children with their type ids - #1472
Merged
Merged
Conversation
DenseUnionVector.getField() lists the children in the order their type ids were registered, while the child vectors are created when first used. getChildrenFromFields() and the transfer pair paired them by creation order, which wrote the buffers of one child under the field of another in exports and mixed up children in transfers. Both now follow the registered type ids. registerNewTypeId() on a vector without declared type ids, such as a transfer target, also skips the type ids in use.
jbonofre
requested review from
laurentgo,
lidavidm and
wgtmac
as code owners
November 13, 2026 10:04
lidavidm
approved these changes
Nov 13, 2026
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
Follow-up to #1419.
DenseUnionVector.getField()lists the children in the order their type ids were registered, while the vector of a child is created when it is first used, which can be in another order. Code that paired the two by position mixed up the children:getChildrenFromFields()returned the vectors in the order they were created, soVectorUnloaderandData.exportVectorwrote the buffers of one child under the field of another. It now returns them in the order ofgetField(), followed by any child added withaddVector()without registering a type id.registerNewTypeId()on a vector without declared type ids, such as the target of a transfer pair, assigned the next type id by count, which can already be in use when the type ids of the source are not0..n-1. It now skips the type ids in use.TestDenseUnionVectorcovers a union whose double child is created before its int child (child order, transfer, split, and aVectorUnloader/VectorLoaderround trip, which read back[2.08E-322, 0]for[1.5, 42]before), and registering a type id on a transfer target with type ids[2, 0].Closes #1471.