Skip to content

Commit e66636d

Browse files
alambandygrovekorowa
authored
Minor: Improve comments in row_hash.rs for skipping aggregation (#11820)
* Improve comments in row_hash.rs for skipping aggregation * Update datafusion/physical-plan/src/aggregates/row_hash.rs Co-authored-by: Andy Grove <agrove@apache.org> * Apply suggestions from code review Co-authored-by: Eduard Karacharov <eduard.karacharov@gmail.com> --------- Co-authored-by: Andy Grove <agrove@apache.org> Co-authored-by: Eduard Karacharov <eduard.karacharov@gmail.com>
1 parent 2cf0956 commit e66636d

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,22 +100,24 @@ struct SpillState {
100100
///
101101
/// See "partial aggregation" discussion on [`GroupedHashAggregateStream`]
102102
struct SkipAggregationProbe {
103-
/// Number of processed input rows
103+
/// Number of processed input rows (updated during probing)
104104
input_rows: usize,
105-
/// Number of total group values for `input_rows`
105+
/// Number of total group values for `input_rows` (updated during probing)
106106
num_groups: usize,
107107

108-
/// Aggregation ratio check should be performed only when the
109-
/// number of input rows exceeds this threshold
108+
/// Aggregation ratio check performed when the number of input rows exceeds
109+
/// this threshold (from `SessionConfig`)
110110
probe_rows_threshold: usize,
111-
/// Maximum allowed value of `input_rows` / `num_groups` to
112-
/// continue aggregation
111+
/// Maximum ratio of `num_groups` to `input_rows` for continuing aggregation
112+
/// (from `SessionConfig`). If the ratio exceeds this value, aggregation
113+
/// is skipped and input rows are directly converted to output
113114
probe_ratio_threshold: f64,
114115

115-
/// Flag indicating that further data aggregation mey be skipped
116+
/// Flag indicating further data aggregation may be skipped (decision made
117+
/// when probing complete)
116118
should_skip: bool,
117-
/// Flag indicating that further updates of `SkipAggregationProbe`
118-
/// state won't make any effect
119+
/// Flag indicating further updates of `SkipAggregationProbe` state won't
120+
/// make any effect (set either while probing or on probing completion)
119121
is_locked: bool,
120122

121123
/// Number of rows where state was output without aggregation.

0 commit comments

Comments
 (0)