pub fn slices(pairs: &[(&[&dyn Array], &SortOptions)]) -> Result<Vec<MergeSlice>> {
    assert!(!pairs.is_empty());
    let comparator = build_comparator(pairs)?;

    // pairs:  [([a00, a01], o1), ([a10, a11], o2), ...]
    // slices: [(0, 0, len), (1, 0, len)]

    let slices = pairs[0]
        .0
        .iter()
        .enumerate()
        .map(|(index, array)| vec![(index, 0, array.len())])
        .collect::<Vec<_>>();

    let slices = slices
        .iter()
        .map(|slice| slice.as_ref())
        .collect::<Vec<_>>();
    Ok(recursive_merge_sort(&slices, &comparator))
}
/// Returns a vector of slices from different sorted arrays that can be used to create sorted arrays.
/// `pairs` is an array representing multiple sorted array sets. The expected format is
///
/// pairs:  [([a00, a01], o1), ([a10, a11], o2), ...]
/// where aj0.len() == aj0.len()
///       aj1.len() == aj1.len()
///       ...
/// In other words, `pairs.i.0[j]` must be an array coming from a batch of equal len arrays.
/// # Example
/// ```rust
/// use arrow2::array::Int32Array;
/// use arrow2::compute::merge_sort::{slices, SortOptions};
/// # use arrow2::error::Result;
/// # fn main() -> Result<()> {
/// let a = Int32Array::from_slice(&[2, 4, 6]);
/// let b = Int32Array::from_slice(&[0, 1, 3]);
/// let slices = slices(&[(&[&a, &b], &SortOptions::default())])?;
/// assert_eq!(slices, vec![(1, 0, 2), (0, 0, 1), (1, 2, 1), (0, 1, 2)]);
///
/// # Ok(())
/// # }
/// ```
/// # Error
/// This function errors if the arrays `a0i` are not pairwise sortable. This happens when either
/// they have not the same [`crate::datatypes::DataType`] or when their [`crate::datatypes::DataType`]
/// does not correspond to a sortable type.
/// # Panic
/// This function panics if:
/// * `pairs` has no elements
/// * the length condition above is not fulfilled
Returns a vector of slices from different sorted arrays that can be used to create sorted arrays.
`pairs` is an array representing multiple sorted array sets. The expected format is


Returns a vector of slices from different sorted arrays that can be used to create sorted arrays . ` pairs ` is an array representing multiple sorted array sets . The expected format is
pub fn slices(pairs: &[(&[&dyn Array], &SortOptions)]) -> Result<Vec<MergeSlice>> {
    assert!(!pairs.is_empty());
    let comparator = build_comparator(pairs)?;
    // pairs:  [([a00, a01], o1), ([a10, a11], o2), ...]
    // slices: [(0, 0, len), (1, 0, len)]
    let slices = pairs[0]
        .0
        .iter()
        .enumerate()
        .map(|(index, array)| vec![(index, 0, array.len())])
        .collect::<Vec<_>>();
    let slices = slices
        .iter()
        .map(|slice| slice.as_ref())
        .collect::<Vec<_>>();
    Ok(recursive_merge_sort(&slices, &comparator))
}
pub fn slices ( pairs : & [ ( & [ & dyn Array ] , & SortOptions ) ] ) -> Result < Vec < MergeSlice > > { assert ! ( pairs is_empty ( ) ) ; let comparator = build_comparator ( pairs ) ? ; // pairs:  [([a00, a01], o1), ([a10, a11], o2), ...] // slices: [(0, 0, len), (1, 0, len)] let slices = pairs [ 0 ] . 0 . iter ( ) . enumerate ( ) . map ( | ( index , array ) | vec ! [ ( index 0 array len ( ) ) ] ) . collect :: < Vec < _ > > ( ) ; let slices = slices . iter ( ) . map ( | slice | slice . as_ref ( ) ) . collect :: < Vec < _ > > ( ) ; Ok ( recursive_merge_sort ( & slices , & comparator ) ) }
Returns a vector of slices from different sorted arrays that can be used to create sorted arrays.
Returns a vector of slices from different sorted arrays that can be used to create sorted arrays .
pairs
&[(&[&dyn Array], &SortOptions)]
pairs
&[(&[&dyn Array], &SortOptions)]
example
```rust
use arrow2::array::Int32Array;
use arrow2::compute::merge_sort::{slices, SortOptions}.
` ` ` rust use arrow2 :: array :: Int32Array ; use arrow2 :: compute :: merge_sort :: { slices SortOptions } .
use arrow2::error::result;
None
fn main() -> result<()> {
None
ok(())
None
}
None
error
This function errors if the arrays `a0i` are not pairwise sortable. This happens when either
they have not the same [`crate::datatypes::DataType`] or when their [`crate::datatypes::DataType`]
does not correspond to a sortable type.
This function errors if the arrays ` a0i ` are not pairwise sortable . This happens when either they have not the same [ ` crate :: datatypes :: DataType ` ] or when their [ ` crate :: datatypes :: DataType ` ] does not correspond to a sortable type .
panic
This function panics if:
`pairs` has no elements
the length condition above is not fulfilled
This function panics if : ` pairs ` has no elements the length condition above is not fulfilled