houqp commented on a change in pull request #7193: URL: https://github.com/apache/arrow/pull/7193#discussion_r432995131
########## File path: rust/arrow/src/compute/kernels/sort.rs ########## @@ -44,8 +46,22 @@ pub fn sort_to_indices( ) -> Result<UInt32Array> { let options = options.unwrap_or_default(); let range = values.offset()..values.len(); - let (v, n): (Vec<usize>, Vec<usize>) = - range.partition(|index| values.is_valid(*index)); + // perform a custom range partition for floats, to account for NaN + let (v, n): (Vec<usize>, Vec<usize>) = if values.data_type() == &DataType::Float32 { Review comment: looks like using match would be cleaner here? ---------------------------------------------------------------- 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: us...@infra.apache.org