Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

growable::union is broken for dense unions #1359

Closed
jleibs opened this issue Jan 14, 2023 · 0 comments · Fixed by #1360
Closed

growable::union is broken for dense unions #1359

jleibs opened this issue Jan 14, 2023 · 0 comments · Fixed by #1360
Labels
no-changelog Issues whose changes are covered by a PR and thus should not be shown in the changelog

Comments

@jleibs
Copy link
Contributor

jleibs commented Jan 14, 2023

The derived array ends up repeating values from the first union in every extension.

Minimal unit test demonstrating the problem here: https://github.com/rerun-io/arrow2/blob/b082fd9b9bdd2a54ed68a6dc5570e457e6c24b00/tests/it/array/growable/union.rs#L73

---- array::growable::union::complex_dense stdout ----
thread 'array::growable::union::complex_dense' panicked at 'assertion failed: `(left == right)`
  left: `UnionArray[1, 2, c, d, e, 6]`,
 right: `UnionArray[1, 2, c, c, d, 1]`', tests/it/array/growable/union.rs:116:5

The crux of the problem occurs here:

The new offsets that are being extended here refer to positions in the original values-array, but need to account for the fact that these will be in a newly-extended values array and need to be adjusted to reflect their new position accordingly.

I'll put up a PR to resolve this in the next day or two, but wanted an issue to refer to when I submit that PR.

@jorgecarleitao jorgecarleitao added the no-changelog Issues whose changes are covered by a PR and thus should not be shown in the changelog label Feb 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-changelog Issues whose changes are covered by a PR and thus should not be shown in the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants