jbonofre opened a new pull request, #1472: URL: https://github.com/apache/arrow-java/pull/1472
## 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, so `VectorUnloader` and `Data.exportVector` wrote the buffers of one child under the field of another. It now returns them in the order of `getField()`, followed by any child added with `addVector()` without registering a type id. - The transfer pair paired each type id with the vector at the same position in the internal struct. It now uses the vector of the type id, and the child of the target with the same name. - `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 not `0..n-1`. It now skips the type ids in use. `TestDenseUnionVector` covers a union whose double child is created before its int child (child order, transfer, split, and a `VectorUnloader` / `VectorLoader` round 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. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
