Skip to content

Commit 7e4818d

Browse files
authored
fix: improve GroupOrdering docs (apache#20994)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes apache#123` indicates that this PR will close issue apache#123. --> - Closes #. ## Rationale for this change While working on apache#20559 I ran across some comments that were outdated / could be improved ## What changes are included in this PR? Improve comments ## Are these changes tested? By CI ## Are there any user-facing changes? Just better docs
1 parent b6b542e commit 7e4818d

File tree

1 file changed

+10
-12
lines changed
  • datafusion/physical-plan/src/aggregates/order

1 file changed

+10
-12
lines changed

datafusion/physical-plan/src/aggregates/order/mod.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ impl GroupOrdering {
5252
}
5353
}
5454

55-
/// Returns how many groups be emitted while respecting the current ordering
56-
/// guarantees, or `None` if no data can be emitted
55+
/// Returns how many groups can be emitted while respecting the current
56+
/// ordering guarantees, or `None` if no data can be emitted.
5757
pub fn emit_to(&self) -> Option<EmitTo> {
5858
match self {
5959
GroupOrdering::None => None,
@@ -84,7 +84,7 @@ impl GroupOrdering {
8484
}
8585
}
8686

87-
/// Updates the state the input is done
87+
/// Updates the state to indicate that the input is complete.
8888
pub fn input_done(&mut self) {
8989
match self {
9090
GroupOrdering::None => {}
@@ -93,8 +93,8 @@ impl GroupOrdering {
9393
}
9494
}
9595

96-
/// remove the first n groups from the internal state, shifting
97-
/// all existing indexes down by `n`
96+
/// Removes the first `n` groups from the internal state, shifting all
97+
/// existing indexes down by `n`.
9898
pub fn remove_groups(&mut self, n: usize) {
9999
match self {
100100
GroupOrdering::None => {}
@@ -103,16 +103,14 @@ impl GroupOrdering {
103103
}
104104
}
105105

106-
/// Called when new groups are added in a batch
106+
/// Called when new groups are added in a batch.
107107
///
108-
/// * `total_num_groups`: total number of groups (so max
109-
/// group_index is total_num_groups - 1).
110-
///
111-
/// * `group_values`: group key values for *each row* in the batch
108+
/// * `batch_group_values`: group key values for each row in the batch
112109
///
113110
/// * `group_indices`: indices for each row in the batch
114111
///
115-
/// * `hashes`: hash values for each row in the batch
112+
/// * `total_num_groups`: total number of groups (so max
113+
/// group_index is total_num_groups - 1).
116114
pub fn new_groups(
117115
&mut self,
118116
batch_group_values: &[ArrayRef],
@@ -135,7 +133,7 @@ impl GroupOrdering {
135133
Ok(())
136134
}
137135

138-
/// Return the size of memory used by the ordering state, in bytes
136+
/// Returns the size of memory used by the ordering state, in bytes.
139137
pub fn size(&self) -> usize {
140138
size_of::<Self>()
141139
+ match self {

0 commit comments

Comments
 (0)