Skip to content

Add a merge sort kernel  #4529

@vincev

Description

@vincev

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

I have an aggregation function that sorts a number of small arrays in parallel and then in the final aggregation step produces a big sorted array from all the smaller sorted arrays.

Currently I am doing a concat, that creates a big array from the smaller sorted arrays, followed by a sort that creates another array, it would be probably more efficient if there was a way to merge the already sorted arrays to a final array in one step.

Describe the solution you'd like

Would be nice to have a function like:

pub fn merge_sort(arrays: &[&dyn Array], options: Option<SortOption>) -> Result<ArrayRef, ArrowError>;

that takes a number of sorted arrays and produces a sorted array by merging them.

Describe alternatives you've considered

I am doing concat followed by sort.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    development-processRelated to development process of arrow-rsenhancementAny new improvement worthy of a entry in the changelog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions