Skip to content

Commit 02e893b

Browse files
committed
rename function and update comment
1 parent c52eabb commit 02e893b

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

datafusion/expr-common/src/groups_accumulator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ pub trait GroupsAccumulator: Send {
111111
///
112112
/// this is when the accumulator would benefit from knowing the order of the group indices.
113113
///
114-
fn group_order_sensitivity(&self) -> bool {
114+
fn supports_with_group_indices_order_mode(&self) -> bool {
115115
false
116116
}
117117

118118
/// Called with the order mode for the group indices.
119119
///
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
121121
/// or after [`Self::state`], [`Self::evaluate`] consumed all the groups.
122122
///
123123
/// 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 {
136136
self: Box<Self>,
137137
_group_indices_order_mode: &InputOrderMode,
138138
) -> Result<Box<dyn GroupsAccumulator>> {
139-
if self.group_order_sensitivity() {
139+
if self.supports_with_group_indices_order_mode() {
140140
not_impl_err!("with_group_indices_order_mode not implemented")
141141
} else {
142142
exec_err!(

datafusion/functions-aggregate-common/src/aggregate/groups_accumulator.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl GroupsAccumulatorAdapter {
220220
/// invokes f(accumulator, values) for each group that has values
221221
/// in group_indices.
222222
///
223-
/// if the group indices are contiguous we avoiding
223+
/// Returns (usize, usize) which is (accumulators memory before invocation, accumulators memory after invocation)
224224
///
225225
/// This function first reorders the input and filter so that
226226
/// values for each group_index are contiguous and then invokes f
@@ -322,6 +322,8 @@ impl GroupsAccumulatorAdapter {
322322
/// This function is the same as [`Self::invoke_per_accumulator_on_non_ordered_group_indices`] but avoid reordering of the
323323
/// input as we know that each group_index is contiguous
324324
///
325+
/// Returns (usize, usize) which is (accumulators memory before invocation, accumulators memory after invocation)
326+
///
325327
fn invoke_per_accumulator_on_contiguous_group_indices<F>(
326328
&mut self,
327329
values: &[ArrayRef],
@@ -421,7 +423,7 @@ impl GroupsAccumulatorAdapter {
421423
}
422424

423425
impl GroupsAccumulator for GroupsAccumulatorAdapter {
424-
fn group_order_sensitivity(&self) -> bool {
426+
fn supports_with_group_indices_order_mode(&self) -> bool {
425427
true
426428
}
427429

datafusion/physical-plan/src/aggregates/row_hash.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ pub(crate) fn create_group_accumulator(
640640
Box::new(GroupsAccumulatorAdapter::new(factory))
641641
};
642642

643-
group_accumulator = if group_accumulator.group_order_sensitivity() {
643+
group_accumulator = if group_accumulator.supports_with_group_indices_order_mode() {
644644
group_accumulator.with_group_indices_order_mode(input_order_mode)?
645645
} else {
646646
group_accumulator
@@ -1106,7 +1106,7 @@ impl GroupedHashAggregateStream {
11061106
.accumulators
11071107
.drain(..)
11081108
.map(|acc| {
1109-
if acc.group_order_sensitivity() {
1109+
if acc.supports_with_group_indices_order_mode() {
11101110
acc.with_group_indices_order_mode(&InputOrderMode::Sorted)
11111111
} else {
11121112
Ok(acc)

0 commit comments

Comments
 (0)