Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Take for UnionArray #4883

Merged
merged 6 commits into from
Oct 2, 2023

Conversation

avantgardnerio
Copy link
Contributor

Which issue does this PR close?

Closes #4882.

Rationale for this change

We should implement Take for UnionArray

What changes are included in this PR?

Take is implemented for UnionArray

Are there any user-facing changes?

Yes, more DataFusion queries should work.

@github-actions github-actions bot added the arrow Changes to the arrow crate label Sep 29, 2023
@tustvold
Copy link
Contributor

This doesn't appear like it would support dense unions? Perhaps we could get a test?

@avantgardnerio
Copy link
Contributor Author

dense unions

Interesting. So with dense unions we use the same buffer to store both sets of values? Probably using the offset_sz = max(size_of(a), size_of(b))? and ptr = index * offset_sz? So there's no .child(0) and .child(1)?

@avantgardnerio
Copy link
Contributor Author

How would you feel if I added a if union_mode == Dense { panic!("Same error as before") }?

@tustvold
Copy link
Contributor

I don't see an issue with not supporting dense unions

Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor suggestion

arrow-select/src/take.rs Outdated Show resolved Hide resolved
avantgardnerio and others added 2 commits October 2, 2023 08:40
Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>
@avantgardnerio avantgardnerio merged commit 4320a75 into apache:master Oct 2, 2023
25 checks passed
@avantgardnerio avantgardnerio deleted the bg_take_union branch October 2, 2023 15:21
avantgardnerio added a commit to coralogix/arrow-rs that referenced this pull request Oct 2, 2023
Implement Take for UnionArray (apache#4883)

(cherry picked from commit 4320a75)
avantgardnerio added a commit to coralogix/arrow-rs that referenced this pull request Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Take for UnionArray
2 participants