Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix checks and merge with master #3

Merged
merged 18 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
613e93e
Merge `53.0.0-dev` dev branch to main (#6126)
alamb Jul 26, 2024
b06ffce
Add support for level histograms added in PARQUET-2261 to `ParquetMet…
etseidl Jul 26, 2024
f42d242
Add ArrowError::ArithmeticError (#6130)
andygrove Jul 26, 2024
e815d06
Implement data_part for intervals (#6071)
nrc Jul 27, 2024
705d341
Remove `SchemaBuilder` dependency from `StructArray` constructors (#6…
Rafferty97 Jul 27, 2024
5f5a82c
Remove automatic buffering in `ipc::reader::FileReader` for for consi…
V0ldek Jul 28, 2024
80ed712
Use `LevelHistogram` in `PageIndex` (#6135)
etseidl Jul 29, 2024
11f2bb8
Fix comparison kernel benchmarks (#6147)
samuelcolvin Jul 29, 2024
bd1e76b
Implement exponential block size growing strategy for `StringViewBuil…
XiangpengHao Jul 29, 2024
0e99e3a
improve LIKE regex (#6145)
samuelcolvin Jul 29, 2024
bf9ce47
Improve `LIKE` performance for "contains" style queries (#6128)
samuelcolvin Jul 29, 2024
bf0ea91
improvements to `(i)starts_with` and `(i)ends_with` performance (#6118)
samuelcolvin Jul 30, 2024
6e893b5
Add `BooleanArray::new_from_packed` and `BooleanArray::new_from_u8` (…
chloro-pn Jul 30, 2024
2905ce6
Update object store MSRV to `1.64` (#6123)
alamb Jul 31, 2024
4d1651c
separate tests that require arrow into a separate module
etseidl Jul 31, 2024
c14ade2
Upgrade protobuf definitions to flightsql 17.0 (#6133) (#6169)
alamb Aug 1, 2024
8691903
Merge remote-tracking branch 'origin/master' into test_merge5
etseidl Aug 1, 2024
241ee02
add histograms to to_thrift()
etseidl Aug 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arrow-arith/src/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub fn multiply_fixed_point_checked(
let mut mul = a.wrapping_mul(b);
mul = divide_and_round::<Decimal256Type>(mul, divisor);
mul.to_i128().ok_or_else(|| {
ArrowError::ComputeError(format!("Overflow happened on: {:?} * {:?}", a, b))
ArrowError::ArithmeticOverflow(format!("Overflow happened on: {:?} * {:?}", a, b))
})
})
.and_then(|a| a.with_precision_and_scale(precision, required_scale))
Expand Down Expand Up @@ -323,7 +323,7 @@ mod tests {

// `multiply` overflows on this case.
let err = mul(&a, &b).unwrap_err();
assert_eq!(err.to_string(), "Compute error: Overflow happened on: 123456789000000000000000000 * 10000000000000000000");
assert_eq!(err.to_string(), "Arithmetic overflow: Overflow happened on: 123456789000000000000000000 * 10000000000000000000");

// Avoid overflow by reducing the scale.
let result = multiply_fixed_point(&a, &b, 28).unwrap();
Expand Down
32 changes: 19 additions & 13 deletions arrow-arith/src/numeric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -888,15 +888,15 @@ mod tests {

test_neg_primitive::<Int32Type>(
&[i32::MIN],
Err("Compute error: Overflow happened on: - -2147483648"),
Err("Arithmetic overflow: Overflow happened on: - -2147483648"),
);
test_neg_primitive::<Int64Type>(
&[i64::MIN],
Err("Compute error: Overflow happened on: - -9223372036854775808"),
Err("Arithmetic overflow: Overflow happened on: - -9223372036854775808"),
);
test_neg_primitive::<DurationSecondType>(
&[i64::MIN],
Err("Compute error: Overflow happened on: - -9223372036854775808"),
Err("Arithmetic overflow: Overflow happened on: - -9223372036854775808"),
);

let r = neg_wrapping(&Int32Array::from(vec![i32::MIN])).unwrap();
Expand All @@ -911,7 +911,7 @@ mod tests {

assert_eq!(
err,
"Compute error: Overflow happened on: - -9223372036854775808"
"Arithmetic overflow: Overflow happened on: - -9223372036854775808"
);

let a = Decimal128Array::from(vec![1, 3, -44, 2, 4])
Expand Down Expand Up @@ -1016,28 +1016,31 @@ mod tests {
let a = UInt8Array::from(vec![56, 5, 3]);
let b = UInt8Array::from(vec![200, 2, 5]);
let err = add(&a, &b).unwrap_err().to_string();
assert_eq!(err, "Compute error: Overflow happened on: 56 + 200");
assert_eq!(err, "Arithmetic overflow: Overflow happened on: 56 + 200");
let result = add_wrapping(&a, &b).unwrap();
assert_eq!(result.as_ref(), &UInt8Array::from(vec![0, 7, 8]));

let a = UInt8Array::from(vec![34, 5, 3]);
let b = UInt8Array::from(vec![200, 2, 5]);
let err = sub(&a, &b).unwrap_err().to_string();
assert_eq!(err, "Compute error: Overflow happened on: 34 - 200");
assert_eq!(err, "Arithmetic overflow: Overflow happened on: 34 - 200");
let result = sub_wrapping(&a, &b).unwrap();
assert_eq!(result.as_ref(), &UInt8Array::from(vec![90, 3, 254]));

let a = UInt8Array::from(vec![34, 5, 3]);
let b = UInt8Array::from(vec![200, 2, 5]);
let err = mul(&a, &b).unwrap_err().to_string();
assert_eq!(err, "Compute error: Overflow happened on: 34 * 200");
assert_eq!(err, "Arithmetic overflow: Overflow happened on: 34 * 200");
let result = mul_wrapping(&a, &b).unwrap();
assert_eq!(result.as_ref(), &UInt8Array::from(vec![144, 10, 15]));

let a = Int16Array::from(vec![i16::MIN]);
let b = Int16Array::from(vec![-1]);
let err = div(&a, &b).unwrap_err().to_string();
assert_eq!(err, "Compute error: Overflow happened on: -32768 / -1");
assert_eq!(
err,
"Arithmetic overflow: Overflow happened on: -32768 / -1"
);

let a = Int16Array::from(vec![21]);
let b = Int16Array::from(vec![0]);
Expand Down Expand Up @@ -1146,15 +1149,15 @@ mod tests {
.with_precision_and_scale(3, -2)
.unwrap();
let err = add(&a, &b).unwrap_err().to_string();
assert_eq!(err, "Compute error: Overflow happened on: 10 ^ 39");
assert_eq!(err, "Arithmetic overflow: Overflow happened on: 10 ^ 39");

let a = Decimal128Array::from(vec![10])
.with_precision_and_scale(3, -1)
.unwrap();
let err = add(&a, &b).unwrap_err().to_string();
assert_eq!(
err,
"Compute error: Overflow happened on: 10 * 100000000000000000000000000000000000000"
"Arithmetic overflow: Overflow happened on: 10 * 100000000000000000000000000000000000000"
);

let b = Decimal128Array::from(vec![0])
Expand Down Expand Up @@ -1349,7 +1352,10 @@ mod tests {
let a = IntervalMonthDayNanoArray::from(vec![IntervalMonthDayNano::MAX]);
let b = IntervalMonthDayNanoArray::from(vec![IntervalMonthDayNano::ONE]);
let err = add(&a, &b).unwrap_err().to_string();
assert_eq!(err, "Compute error: Overflow happened on: 2147483647 + 1");
assert_eq!(
err,
"Arithmetic overflow: Overflow happened on: 2147483647 + 1"
);
}

fn test_duration_impl<T: ArrowPrimitiveType<Native = i64>>() {
Expand Down Expand Up @@ -1384,7 +1390,7 @@ mod tests {
let err = add(&a, &b).unwrap_err().to_string();
assert_eq!(
err,
"Compute error: Overflow happened on: 9223372036854775807 + 1"
"Arithmetic overflow: Overflow happened on: 9223372036854775807 + 1"
);
}

Expand Down Expand Up @@ -1511,7 +1517,7 @@ mod tests {
let err = sub(&a, &b).unwrap_err().to_string();
assert_eq!(
err,
"Compute error: Overflow happened on: 9223372036854775807 - -1"
"Arithmetic overflow: Overflow happened on: 9223372036854775807 - -1"
);
}
}
Loading
Loading