Skip to content

Commit e5840d7

Browse files
committed
Add more sort_primitive tests for sorts /w limit
1 parent 7bc3523 commit e5840d7

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

arrow/src/compute/kernels/sort.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ mod tests {
15601560
vec![Some(1.0), Some(2.0), Some(3.0)],
15611561
);
15621562

1563-
// limit that includes some extra nulls
1563+
// valid values less than limit with extra nulls
15641564
test_sort_primitive_arrays::<Float64Type>(
15651565
vec![Some(2.0), None, None, Some(1.0)],
15661566
Some(SortOptions {
@@ -1571,7 +1571,17 @@ mod tests {
15711571
vec![Some(1.0), Some(2.0), None],
15721572
);
15731573

1574-
// too many nulls
1574+
test_sort_primitive_arrays::<Float64Type>(
1575+
vec![Some(2.0), None, None, Some(1.0)],
1576+
Some(SortOptions {
1577+
descending: false,
1578+
nulls_first: true,
1579+
}),
1580+
Some(3),
1581+
vec![None, None, Some(1.0)],
1582+
);
1583+
1584+
// more nulls than limit
15751585
test_sort_primitive_arrays::<Float64Type>(
15761586
vec![Some(2.0), None, None, None],
15771587
Some(SortOptions {
@@ -1581,6 +1591,16 @@ mod tests {
15811591
Some(2),
15821592
vec![None, None],
15831593
);
1594+
1595+
test_sort_primitive_arrays::<Float64Type>(
1596+
vec![Some(2.0), None, None, None],
1597+
Some(SortOptions {
1598+
descending: false,
1599+
nulls_first: false,
1600+
}),
1601+
Some(2),
1602+
vec![Some(2.0), None],
1603+
);
15841604
}
15851605

15861606
#[test]

0 commit comments

Comments
 (0)