Dandandan commented on code in PR #19278:
URL: https://github.com/apache/datafusion/pull/19278#discussion_r2613640127
##########
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:
> Perhaps we can modify the calculate_median method to accept a &mut instead
of taking by value
Hah I see you already suggested this ;)
##########
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:
> Perhaps we can modify the calculate_median method to accept a &mut instead
of taking by value
Hah I see you already suggested this ;)
--
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]