alamb commented on code in PR #6721:
URL: https://github.com/apache/arrow-datafusion/pull/6721#discussion_r1235652729
##########
datafusion/physical-expr/src/aggregate/utils.rs:
##########
@@ -60,25 +60,25 @@ pub fn calculate_result_decimal_for_avg(
if new_value >= target_min && new_value <= target_max {
Ok(ScalarValue::Decimal128(Some(new_value), *p, *s))
} else {
- Err(DataFusionError::Internal(
+ Err(DataFusionError::Execution(
"Arithmetic Overflow in
AvgAccumulator".to_string(),
))
}
} else {
// can't convert the lit decimal to the returned data type
- Err(DataFusionError::Internal(
+ Err(DataFusionError::Execution(
"Arithmetic Overflow in AvgAccumulator".to_string(),
))
}
} else {
// can't convert the lit decimal to the returned data type
- Err(DataFusionError::Internal(
+ Err(DataFusionError::Execution(
"Arithmetic Overflow in AvgAccumulator".to_string(),
))
}
}
other => Err(DataFusionError::Internal(format!(
Review Comment:
I think this error is if `calculate_result_decimal_for_avg` gets called with
a non `DataType::Decimal` argument, which I *think* the type dispatch is
supposed to prevent.
Thus I think `Internal` is still the appropriate error in this area
--
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]