manishkr commented on code in PR #9036:
URL: https://github.com/apache/arrow-rs/pull/9036#discussion_r2652408808
##########
arrow-select/src/concat.rs:
##########
@@ -1879,4 +1886,34 @@ mod tests {
assert_eq!(values.len(), 6);
assert_eq!(&[10, 20, 30, 40, 50, 60], values.values());
}
+
+ #[test]
+ fn test_concat_run_array_with_truncated_run() {
+ // Create a run array with run ends [2, 5] and values [10, 20]
+ // Logical: [10, 10, 20, 20, 20]
+ let run_ends1 = Int32Array::from(vec![2, 5]);
+ let values1 = Int32Array::from(vec![10, 20]);
+ let array1 = RunArray::try_new(&run_ends1, &values1).unwrap();
+
+ // Slice(0, 3) -> [10, 10, 20]
+ // The last physical run for this slice is the second run (ends at 5).
+ // Without min(length), its run end would be 5 - 0 = 5.
+ // With min(length), it becomes min(5 - 0, 3) = 3.
Review Comment:
Thanks. Added more explanation note, also added comment in code as suggested
above.
--
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]