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

Support interleave kernel with deep copy buffers for StringViewArray #7184

Open
2010YOUY01 opened this issue Feb 24, 2025 · 3 comments
Open
Labels
enhancement Any new improvement worthy of a entry in the changelog

Comments

@2010YOUY01
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

fn interleave_views<T: ByteViewType>(

Current implementation of interleave kernel on StringViewArray reuses the existing buffers from source arrays, it's only reconstructing views specified by the interleaving operation. It's useful to also support interleave by reconstructing buffers. (For example, if the referenced elements are sparse)

Describe the solution you'd like

Provides an additional interface for StringViewArray to do interleave with deep copy buffers.

Describe alternatives you've considered

Additional context

@2010YOUY01 2010YOUY01 added the enhancement Any new improvement worthy of a entry in the changelog label Feb 24, 2025
@tustvold
Copy link
Contributor

tustvold commented Feb 24, 2025

I wonder if instead of baking this into the interleave kernel, and potentially others besides, it would be better for applications to call https://docs.rs/arrow-array/latest/arrow_array/array/struct.GenericByteViewArray.html#method.gc when appropriate?

This would have a number of advantages:

  • Don't need to modify multiple kernels
  • Applications can chain kernels and only perform GC once at the end
  • Applications are in control of any heuristics as to when this should take place

@2010YOUY01
Copy link
Contributor Author

I wonder if instead of baking this into the interleave kernel, and potentially others besides, it would be better for applications to call https://docs.rs/arrow-array/latest/arrow_array/array/struct.GenericByteViewArray.html#method.gc when appropriate?

This would have a number of advantages:

  • Don't need to modify multiple kernels
  • Applications can chain kernels and only perform GC once at the end
  • Applications are in control of any heuristics as to when this should take place

Thanks for the perspectives. We're currently using gc(). Performing the copy within the interleave kernel is just slightly more efficient.
If adding an additional interface inside arrow isn't ideal, we can implement this fused logic at the application level.

@alamb
Copy link
Contributor

alamb commented Feb 25, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any new improvement worthy of a entry in the changelog
Projects
None yet
Development

No branches or pull requests

3 participants