viirya commented on code in PR #7494:
URL: https://github.com/apache/arrow-datafusion/pull/7494#discussion_r1318992287
##########
datafusion/physical-expr/src/aggregate/average.rs:
##########
@@ -488,12 +488,10 @@ where
.map(|(sum, count)| (self.avg_fn)(sum, count))
.collect::<Result<Vec<_>>>()?;
PrimitiveArray::new(averages.into(), Some(nulls)) // no copy
+ .with_data_type(self.return_data_type.clone())
};
- // fix up decimal precision and scale for decimals
- let array = adjust_output_array(&self.return_data_type,
Arc::new(array))?;
Review Comment:
I guess this was add before `with_data_type` is introduced as API.
##########
datafusion/physical-expr/src/aggregate/average.rs:
##########
@@ -488,12 +488,10 @@ where
.map(|(sum, count)| (self.avg_fn)(sum, count))
.collect::<Result<Vec<_>>>()?;
PrimitiveArray::new(averages.into(), Some(nulls)) // no copy
+ .with_data_type(self.return_data_type.clone())
};
- // fix up decimal precision and scale for decimals
- let array = adjust_output_array(&self.return_data_type,
Arc::new(array))?;
Review Comment:
I guess this was added before `with_data_type` is introduced as API.
--
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]