onursatici opened a new pull request, #6779:
URL: https://github.com/apache/arrow-rs/pull/6779

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and 
enhancements and this helps us generate change logs for our releases. You can 
link an issue to this PR using the GitHub syntax. For example `Closes #123` 
indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
   # Rationale for this change
    
   Currently interleaving `ByteViewArray`s are done with the fallback 
implementation, which uses a `MutableArrayBuilder`. The `extend` method on this 
builder is copying over all variadic buffers because it doesn't know if there 
are buffers not referenced by any views in the array. Especially on 
datafusion's TopK implementation, which uses an heap that interleaves arrow 
arrays to produce the top k rows, current interleave implementation results in 
an explosion of variadic buffer count for byte view arrays, adding the same set 
of buffers over and over again. Where this becomes really problematic is when 
sending such arrays over flight, current encoder materialises all variadic 
buffers.
   
   # What changes are included in this PR?
   
   Add a `ByteViewArray` specific interleave implementation that does not add a 
previously referenced variadic buffer when building the interleaved array
   
   # Are there any user-facing changes?
   
   
   <!--
   If there are user-facing changes then we may require documentation to be 
updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please call them out.
   -->
   TODO:
   - [ ] test. I only tested this locally. Will add a unit test
   


-- 
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]

Reply via email to