Rich-T-kid commented on code in PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377#discussion_r4058338084
##########
arrow-select/src/concat.rs:
##########
@@ -1889,6 +1896,27 @@ mod tests {
assert_eq!(&[10, 20, 30, 40], values.values());
}
+ #[test]
+ fn test_concat_run_array_length_overflows_run_end_type() {
+ // 20_000 + 20_000 exceeds i16::MAX.
+ let array1 = RunArray::<Int16Type>::try_new(
+ &Int16Array::from(vec![20_000]),
+ &Int16Array::from(vec![1]),
+ )
+ .unwrap();
+ let array2 = RunArray::<Int16Type>::try_new(
+ &Int16Array::from(vec![20_000]),
+ &Int16Array::from(vec![2]),
+ )
+ .unwrap();
+
+ let err = concat(&[&array1, &array2]).unwrap_err();
+ assert!(
+ err.to_string().contains("overflows the run-end type"),
+ "expected a run-end overflow error, got: {err}"
+ );
Review Comment:
I think it would be a good idea to just match on the specific error, I.E
`arrow::computeError`.
I would say
[reeOverflow](https://docs.rs/arrow/latest/arrow/error/enum.ArrowError.html#variant.RunEndIndexOverflowError)
may make sense here but it looks slightly different
##########
arrow-select/src/take.rs:
##########
@@ -2094,18 +2093,12 @@ mod tests {
#[test]
fn test_take_bool_nullable_index() {
// indices where the masked invalid elements would be out of bounds
- let index_data = ArrayData::try_new(
Review Comment:
I think the issue was referring to application code but this is also nice 😅
##########
arrow-select/src/nullif.rs:
##########
@@ -578,31 +578,13 @@ mod tests {
/// Returns a new BooleanArray with no null buffer
fn remove_null_buffer(array: &BooleanArray) -> BooleanArray {
- make_array(
Review Comment:
👍
--
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]