Skip to content

Commit 601c7b2

Browse files
committed
improve comments.
1 parent b2c36e8 commit 601c7b2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

datafusion/physical-plan/src/aggregates/group_values/aggregation_hashtable.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,18 @@ impl<T: AggregationHashTableEntry> AggregationHashTable<T> {
101101
let table_entry = match &table_entry {
102102
AggregationHashTableEntryState::Empty => {
103103
self.pending_append_indices.push(row_idx);
104+
// We place the `future group index` into `raw_table`.
105+
// And if rows with same hash values(repeated row in most situations)
106+
// exist in input `cols`, it is able to get this `future group index` here
107+
// and use compare the related `group value` after it is really inserted.
104108
*table_entry = AggregationHashTableEntryState::PlaceHolder(
105109
current_total_groups,
106110
);
107111
current_total_groups += 1;
108112
continue;
109113
}
110114
AggregationHashTableEntryState::PlaceHolder(group_index) => {
115+
// The situation that rows with same ash values exist in `cols` mentioned above
111116
let equal_to_ctx = EqualToContext {
112117
row_index: row_idx,
113118
group_index: *group_index,

0 commit comments

Comments
 (0)