You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/02/13 14:02:33 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3705: perf: `take_run` improvements

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


##########
arrow-select/src/take.rs:
##########
@@ -2166,17 +2174,17 @@ mod tests {
         let run_array = builder.finish();
 
         let take_indices: PrimitiveArray<Int32Type> =
-            vec![2, 7, 10].into_iter().collect();
+            vec![7, 2, 3, 7, 10].into_iter().collect();
 
         let take_out = take_run(&run_array, &take_indices).unwrap();
 
-        assert_eq!(take_out.len(), 3);
+        assert_eq!(take_out.len(), 5);
 
-        assert_eq!(take_out.run_ends().len(), 1);
-        assert_eq!(take_out.run_ends().value(0), 3);
+        assert_eq!(take_out.run_ends().len(), 4);
+        assert_eq!(take_out.run_ends().values(), &[1_i32, 3, 4, 5]);
 
         let take_out_values = as_primitive_array::<Int32Type>(take_out.values());
-        assert_eq!(take_out_values.value(0), 2);
+        assert_eq!(take_out_values.values(), &[2, 2, 2, 2]);

Review Comment:
   Just an idea but it might be worth testing that non-consecutive logical indices that correspond to the same physical index are correctly combined into a single output run.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org