Dandandan commented on code in PR #19278:
URL: https://github.com/apache/datafusion/pull/19278#discussion_r2612173713
##########
datafusion/functions-aggregate/src/median.rs:
##########
@@ -289,14 +289,32 @@ impl<T: ArrowNumericType> Accumulator for
MedianAccumulator<T> {
}
fn evaluate(&mut self) -> Result<ScalarValue> {
- let d = std::mem::take(&mut self.all_values);
+ let d = self.all_values.clone();
Review Comment:
Can't you change the interface of calculate_median to take a mutable
reference instead?
```
fn calculate_median<T: ArrowNumericType>(
values: &mut [T::Native],
)
```
--
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]