alamb commented on a change in pull request #1408:
URL: https://github.com/apache/arrow-datafusion/pull/1408#discussion_r769985627
##########
File path: datafusion/src/physical_plan/expressions/average.rs
##########
@@ -38,11 +38,18 @@ use super::{format_state_name, sum};
pub struct Avg {
name: String,
expr: Arc<dyn PhysicalExpr>,
+ data_type: DataType,
}
/// function return type of an average
pub fn avg_return_type(arg_type: &DataType) -> Result<DataType> {
match arg_type {
+ DataType::Decimal(precision, scale) => {
+ // the new precision and scale for return type of avg function
Review comment:
I think following the spark behavior is reasonable, but it should be
documented (aka that the constant `4` came from spark).
--
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]