Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor: Improve comments in row_hash.rs for skipping aggregation #11820

Merged
merged 4 commits into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions datafusion/physical-plan/src/aggregates/row_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,24 @@ struct SpillState {
///
/// See "partial aggregation" discussion on [`GroupedHashAggregateStream`]
struct SkipAggregationProbe {
/// Number of processed input rows
/// Number of processed input rows (updated during probing)
input_rows: usize,
/// Number of total group values for `input_rows`
/// Number of total group values for `input_rows` (updated during probing)
num_groups: usize,

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

/// Flag indicating that further data aggregation mey be skipped
/// Flag indicating further data aggregation may be skipped (decision made
/// when probing complete)
should_skip: bool,
/// Flag indicating that further updates of `SkipAggregationProbe`
/// state won't make any effect
/// Flag indicating further updates of `SkipAggregationProbe` state won't
/// make any effect (set either while probing or on probing completion)
is_locked: bool,

/// Number of rows where state was output without aggregation.
Expand Down
Loading