You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: Optimize array_concat using MutableArrayData (apache#20620)
## Which issue does this PR close?
- Closesapache#20619 .
## Rationale for this change
The current implementation of `array_concat` creates an `ArrayRef` for
each row, uses Arrow's `concat` kernel to merge the elements together,
and then uses `concat` again to produce the final results. This does a
lot of unnecessary allocation and copying.
Instead, we can use `MutableArrayData::extend` to copy element ranges in
bulk, which avoids much of this intermediate copying and allocation.
This approach is 5-15x faster on a microbenchmark.
## What changes are included in this PR?
* Add benchmark
* Improve SLT test coverage for `array_concat`
* Implement optimization
## Are these changes tested?
Yes, and benchmarked.
## Are there any user-facing changes?
No.
(cherry picked from commit d2df7a5)
query error DataFusion error: Error during planning: Execution error: Function 'array_concat' user-defined coercion failed with "Error during planning: array_concat does not support type Int64"
0 commit comments