Dandandan commented on code in PR #7376:
URL: https://github.com/apache/arrow-datafusion/pull/7376#discussion_r1302060717


##########
datafusion/physical-expr/src/aggregate/median.rs:
##########
@@ -106,159 +126,75 @@ impl PartialEq<dyn Any> for Median {
     }
 }
 
-#[derive(Debug)]
 /// The median accumulator accumulates the raw input values
 /// as `ScalarValue`s
 ///
 /// The intermediate state is represented as a List of scalar values updated by
 /// `merge_batch` and a `Vec` of `ArrayRef` that are converted to scalar values
 /// in the final evaluation step so that we avoid expensive conversions and
 /// allocations during `update_batch`.
-struct MedianAccumulator {
+struct MedianAccumulator<T: ArrowNumericType> {
     data_type: DataType,
-    arrays: Vec<ArrayRef>,
-    all_values: Vec<ScalarValue>,
+    all_values: Vec<T::Native>,

Review Comment:
   👍 



##########
datafusion/physical-expr/src/aggregate/median.rs:
##########
@@ -106,159 +126,75 @@ impl PartialEq<dyn Any> for Median {
     }
 }
 
-#[derive(Debug)]
 /// The median accumulator accumulates the raw input values
 /// as `ScalarValue`s
 ///
 /// The intermediate state is represented as a List of scalar values updated by
 /// `merge_batch` and a `Vec` of `ArrayRef` that are converted to scalar values
 /// in the final evaluation step so that we avoid expensive conversions and
 /// allocations during `update_batch`.
-struct MedianAccumulator {
+struct MedianAccumulator<T: ArrowNumericType> {
     data_type: DataType,
-    arrays: Vec<ArrayRef>,
-    all_values: Vec<ScalarValue>,
+    all_values: Vec<T::Native>,

Review Comment:
   👍 



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to