andygrove commented on code in PR #2136:
URL: https://github.com/apache/datafusion-comet/pull/2136#discussion_r2379312206
##########
native/spark-expr/src/math_funcs/checked_arithmetic.rs:
##########
@@ -84,39 +141,55 @@ where
pub fn checked_add(
args: &[ColumnarValue],
data_type: &DataType,
+ eval_mode: EvalMode,
) -> Result<ColumnarValue, DataFusionError> {
- checked_arithmetic_internal(args, data_type, "checked_add")
+ checked_arithmetic_internal(args, data_type, "checked_add", eval_mode)
}
pub fn checked_sub(
args: &[ColumnarValue],
data_type: &DataType,
+ eval_mode: EvalMode,
) -> Result<ColumnarValue, DataFusionError> {
- checked_arithmetic_internal(args, data_type, "checked_sub")
+ checked_arithmetic_internal(args, data_type, "checked_sub", eval_mode)
}
pub fn checked_mul(
args: &[ColumnarValue],
data_type: &DataType,
+ eval_mode: EvalMode,
) -> Result<ColumnarValue, DataFusionError> {
- checked_arithmetic_internal(args, data_type, "checked_mul")
+ checked_arithmetic_internal(args, data_type, "checked_mul", eval_mode)
}
pub fn checked_div(
args: &[ColumnarValue],
data_type: &DataType,
+ eval_mode: EvalMode,
) -> Result<ColumnarValue, DataFusionError> {
- checked_arithmetic_internal(args, data_type, "checked_div")
+ checked_arithmetic_internal(args, data_type, "checked_div", eval_mode)
}
fn checked_arithmetic_internal(
args: &[ColumnarValue],
data_type: &DataType,
op: &str,
+ eval_mode: EvalMode,
) -> Result<ColumnarValue, DataFusionError> {
let left = &args[0];
let right = &args[1];
+ let is_ansi_mode = match eval_mode {
+ EvalMode::Try => false,
+ EvalMode::Ansi => true,
Review Comment:
This doesn't seem correct. Ansi mode should throw errors on overflow, and
Try should return null?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]