neilconway opened a new pull request, #20459:
URL: https://github.com/apache/datafusion/pull/20459

   ## Which issue does this PR close?
   
   - Closes #20458.
   
   ## Rationale for this change
   
   When `array_to_size(n)` was called on a `List`-like object containing a 
`StringViewArray` with `b` data buffers, the previous implementation returned a 
list containing a `StringViewArray` with `n*b` buffers, which leads to 
catastrophically bad performance if `b` grows even somewhat large.
   
   ## What changes are included in this PR?
   
   Instead of using `repeat_n` + `concat` to merge together `n` copies of the 
`StringViewArray`, we instead use `take`, which preserves the same number of 
buffers as the input `StringViewArray`.
   
   This PR also adds a new benchmark for this situation.
   
   ## Are these changes tested?
   
   Yes and benchmarked.
   
   ## Are there any user-facing changes?
   
   No.
   
   ## AI usage
   
   Iterated on the problem with Claude Code; I understand the problem and the 
solution.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to