File tree 3 files changed +9
-7
lines changed
functions-aggregate-common/src/aggregate
physical-plan/src/aggregates
3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -111,13 +111,13 @@ pub trait GroupsAccumulator: Send {
111
111
///
112
112
/// this is when the accumulator would benefit from knowing the order of the group indices.
113
113
///
114
- fn group_order_sensitivity ( & self ) -> bool {
114
+ fn supports_with_group_indices_order_mode ( & self ) -> bool {
115
115
false
116
116
}
117
117
118
118
/// Called with the order mode for the group indices.
119
119
///
120
- /// This will only be called if [`Self::group_order_sensitivity `] is true and can be called either right after initialization
120
+ /// This will only be called if [`Self::supports_with_group_indices_order_mode `] is true and can be called either right after initialization
121
121
/// or after [`Self::state`], [`Self::evaluate`] consumed all the groups.
122
122
///
123
123
/// For example if `group_indices_order_mode` equals to [`InputOrderMode::Sorted`] it means that if you get the following group indices in [`Self::update_batch`]/[`Self::merge_batch`]
@@ -136,7 +136,7 @@ pub trait GroupsAccumulator: Send {
136
136
self : Box < Self > ,
137
137
_group_indices_order_mode : & InputOrderMode ,
138
138
) -> Result < Box < dyn GroupsAccumulator > > {
139
- if self . group_order_sensitivity ( ) {
139
+ if self . supports_with_group_indices_order_mode ( ) {
140
140
not_impl_err ! ( "with_group_indices_order_mode not implemented" )
141
141
} else {
142
142
exec_err ! (
Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ impl GroupsAccumulatorAdapter {
220
220
/// invokes f(accumulator, values) for each group that has values
221
221
/// in group_indices.
222
222
///
223
- /// if the group indices are contiguous we avoiding
223
+ /// Returns (usize, usize) which is (accumulators memory before invocation, accumulators memory after invocation)
224
224
///
225
225
/// This function first reorders the input and filter so that
226
226
/// values for each group_index are contiguous and then invokes f
@@ -322,6 +322,8 @@ impl GroupsAccumulatorAdapter {
322
322
/// This function is the same as [`Self::invoke_per_accumulator_on_non_ordered_group_indices`] but avoid reordering of the
323
323
/// input as we know that each group_index is contiguous
324
324
///
325
+ /// Returns (usize, usize) which is (accumulators memory before invocation, accumulators memory after invocation)
326
+ ///
325
327
fn invoke_per_accumulator_on_contiguous_group_indices < F > (
326
328
& mut self ,
327
329
values : & [ ArrayRef ] ,
@@ -421,7 +423,7 @@ impl GroupsAccumulatorAdapter {
421
423
}
422
424
423
425
impl GroupsAccumulator for GroupsAccumulatorAdapter {
424
- fn group_order_sensitivity ( & self ) -> bool {
426
+ fn supports_with_group_indices_order_mode ( & self ) -> bool {
425
427
true
426
428
}
427
429
Original file line number Diff line number Diff line change @@ -640,7 +640,7 @@ pub(crate) fn create_group_accumulator(
640
640
Box :: new ( GroupsAccumulatorAdapter :: new ( factory) )
641
641
} ;
642
642
643
- group_accumulator = if group_accumulator. group_order_sensitivity ( ) {
643
+ group_accumulator = if group_accumulator. supports_with_group_indices_order_mode ( ) {
644
644
group_accumulator. with_group_indices_order_mode ( input_order_mode) ?
645
645
} else {
646
646
group_accumulator
@@ -1106,7 +1106,7 @@ impl GroupedHashAggregateStream {
1106
1106
. accumulators
1107
1107
. drain ( ..)
1108
1108
. map ( |acc| {
1109
- if acc. group_order_sensitivity ( ) {
1109
+ if acc. supports_with_group_indices_order_mode ( ) {
1110
1110
acc. with_group_indices_order_mode ( & InputOrderMode :: Sorted )
1111
1111
} else {
1112
1112
Ok ( acc)
You can’t perform that action at this time.
0 commit comments