tustvold commented on code in PR #4473:
URL: https://github.com/apache/arrow-rs/pull/4473#discussion_r1252128677


##########
arrow-ord/src/sort.rs:
##########
@@ -57,11 +58,74 @@ pub fn sort(
     values: &dyn Array,
     options: Option<SortOptions>,
 ) -> Result<ArrayRef, ArrowError> {
-    if let DataType::RunEndEncoded(_, _) = values.data_type() {
-        return sort_run(values, options, None);
+    downcast_primitive_array!(
+        values => return sort_native_type(values, options),
+        DataType::RunEndEncoded(_, _) => return sort_run(values, options, 
None),
+        _ => {
+            let indices = sort_to_indices(values, options, None)?;
+            return take(values, &indices, None)

Review Comment:
   ```suggestion
           values => sort_native_type(values, options),
           DataType::RunEndEncoded(_, _) => sort_run(values, options, None),
           _ => {
               let indices = sort_to_indices(values, options, None)?;
               take(values, &indices, None)
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to