Skip to content

Commit 9ab33ab

Browse files
committed
fix
1 parent cf2b2a4 commit 9ab33ab

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

native/spark-expr/src/math_funcs/internal/checkoverflow.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use crate::utils::is_valid_decimal_precision;
1919
use arrow::datatypes::{DataType, Schema};
2020
use arrow::{
21-
array::{as_primitive_array, Array, Decimal128Array},
21+
array::{as_primitive_array, Array},
2222
datatypes::Decimal128Type,
2323
record_batch::RecordBatch,
2424
};
@@ -113,21 +113,6 @@ impl PhysicalExpr for CheckOverflow {
113113

114114
let decimal_array = as_primitive_array::<Decimal128Type>(&array);
115115

116-
// Get input precision to check if we can skip validation
117-
let (input_precision, input_scale) = match decimal_array.data_type() {
118-
DataType::Decimal128(p, s) => (*p, *s),
119-
_ => unreachable!(),
120-
};
121-
122-
// Optimization: if input precision <= target precision and scales match,
123-
// no overflow is possible - just update metadata
124-
if input_precision <= target_precision && input_scale == target_scale {
125-
let new_array = decimal_array
126-
.clone()
127-
.with_precision_and_scale(target_precision, target_scale)?;
128-
return Ok(ColumnarValue::Array(Arc::new(new_array)));
129-
}
130-
131116
let result_array = if self.fail_on_error {
132117
// ANSI mode: validate and return error on overflow
133118
// Use optimized validation that avoids error string allocation until needed

0 commit comments

Comments
 (0)