Skip to content
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
22 changes: 10 additions & 12 deletions datafusion/physical-plan/src/aggregates/order/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ impl GroupOrdering {
}
}

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

/// Updates the state the input is done
/// Updates the state to indicate that the input is complete.
pub fn input_done(&mut self) {
match self {
GroupOrdering::None => {}
Expand All @@ -93,8 +93,8 @@ impl GroupOrdering {
}
}

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

/// Called when new groups are added in a batch
/// Called when new groups are added in a batch.
///
/// * `total_num_groups`: total number of groups (so max
/// group_index is total_num_groups - 1).
///
/// * `group_values`: group key values for *each row* in the batch
/// * `batch_group_values`: group key values for each row in the batch
///
/// * `group_indices`: indices for each row in the batch
///
/// * `hashes`: hash values for each row in the batch
/// * `total_num_groups`: total number of groups (so max
/// group_index is total_num_groups - 1).
pub fn new_groups(
&mut self,
batch_group_values: &[ArrayRef],
Expand All @@ -135,7 +133,7 @@ impl GroupOrdering {
Ok(())
}

/// Return the size of memory used by the ordering state, in bytes
/// Returns the size of memory used by the ordering state, in bytes.
pub fn size(&self) -> usize {
size_of::<Self>()
+ match self {
Expand Down
Loading