Skip to content

Commit 1b8b212

Browse files
pepijnvealamb
andauthored
Add merge and merge_n kernels (#8753)
# Which issue does this PR close? - Closes #8752. # Rationale for this change The algorithms suggested in this PR originate from the `case` logic in DataFusion (see [datafusion#18152](apache/datafusion#18152) and [datafusion#18444](apache/datafusion#18444)). I think it might be useful to move them to `arrow-rs` instead of being tucked away in a corner of the DataFusion codebase. # What changes are included in this PR? Adds a two-way and n-way merge algorithm that's halfway between `zip` and `interleave`. In contrast to `zip` the truthy and falsy arrays do not need to be prealigned. In contrast to `interleave` the relative order of elements in each input array is retained in the final result. # Are these changes tested? I've already added two minimal unit tests, more should probably be added. # Are there any user-facing changes? No breaking API changes --------- Co-authored-by: Andrew Lamb <[email protected]>
1 parent 5ee07d1 commit 1b8b212

File tree

6 files changed

+904
-2
lines changed

6 files changed

+904
-2
lines changed

arrow-select/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ pub mod concat;
2929
pub mod dictionary;
3030
pub mod filter;
3131
pub mod interleave;
32+
pub mod merge;
3233
pub mod nullif;
3334
pub mod take;
3435
pub mod union_extract;

0 commit comments

Comments
 (0)