andygrove commented on a change in pull request #7193:
URL: https://github.com/apache/arrow/pull/7193#discussion_r426027665
##########
File path: rust/arrow/src/compute/kernels/sort.rs
##########
@@ -283,6 +285,30 @@ mod tests {
None,
vec![3, 1, 4, 2, 0, 5],
);
+ test_sort_to_indices_primitive_arrays::<Float32Type>(
+ vec![
+ None,
+ Some(-0.05),
+ Some(2.225),
+ Some(-1.01),
+ Some(-0.05),
+ None,
+ ],
+ None,
+ vec![3, 1, 4, 2, 0, 5],
+ );
+ test_sort_to_indices_primitive_arrays::<Float64Type>(
+ vec![
+ None,
+ Some(-0.05),
+ Some(2.225),
+ Some(-1.01),
+ Some(-0.05),
+ None,
Review comment:
The problem with this approach is that the NaN could be a, or b, or both
so this comparison is now non-deterministic and inconsistent. I think
implementing this specifically for Float32Array and Float64Array and checking
for NaN on both values is the only way we can handle this correctly.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]