You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Dandandan (via GitHub)" <gi...@apache.org> on 2023/08/22 18:50:55 UTC
[GitHub] [arrow-datafusion] Dandandan commented on a diff in pull request #7376: Specialize Median Accumulator
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org