ChristianBeilschmidt opened a new issue, #4746:
URL: https://github.com/apache/arrow-rs/issues/4746

   **Describe the bug**
   <!--
   A clear and concise description of what the bug is.
   -->
   
   Arrow 46.0 leads to a change in `sort_to_indices` for `FixedSizeListArray`s. 
From my point of view, this is wrong.
   
   **To Reproduce**
   
   I created a minimal example:
   
   ```Rust
   fn sort_example() {
       let a = {
           let mut builder = FixedSizeListBuilder::new(Int64Builder::new(), 2);
   
           for value in [[1, 5], [0, 3], [1, 3]] {
               builder.values().append_slice(&value);
               builder.append(true);
           }
   
           builder.finish()
       };
   
       // dbg!(&a);
   
       let sort_options = Some(arrow::compute::SortOptions {
           descending: false,
           nulls_first: false,
       });
   
       let sort_indices = arrow::compute::sort_to_indices(&a, sort_options, 
None).unwrap();
   
       let array_ref = arrow::compute::take(&a, &sort_indices, None).unwrap();
   
       let b: &FixedSizeListArray = array_ref.as_fixed_size_list();
   
       // dbg!(&b);
   
       let c = {
           let mut builder = FixedSizeListBuilder::new(Int64Builder::new(), 2);
   
           for value in [[0, 3], [1, 3], [1, 5]] {
               builder.values().append_slice(&value);
               builder.append(true);
           }
   
           builder.finish()
       };
   
       assert_eq!(b, &c);
   }
   ```
   
   …leads for `b` being…
   
   ```
   FixedSizeListArray<2>
   [
     PrimitiveArray<Int64>
   [
     0,
     3,
   ],
     PrimitiveArray<Int64>
   [
     1,
     5,
   ],
     PrimitiveArray<Int64>
   [
     1,
     3,
   ],
   ]
   ```
   
   **Expected behavior**
   <!--
   A clear and concise description of what you expected to happen.
   -->
   
   `b` should be…
   
   ```
   FixedSizeListArray<2>
   [
     PrimitiveArray<Int64>
   [
     0,
     3,
   ],
     PrimitiveArray<Int64>
   [
     1,
     3,
   ],
     PrimitiveArray<Int64>
   [
     1,
     5,
   ],
   ]
   ```
   
   …as it was in arrow 45.0.
   
   **Additional context**
   <!--
   Add any other context about the problem here.
   -->
   
   I haven't checked if it is `sort_to_indices` or `take`, but I assume the 
first one.


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