Skip to content

Commit d4b5820

Browse files
committed
define the structs useful in vectorizing.
1 parent 5fd63e8 commit d4b5820

File tree

1 file changed

+29
-4
lines changed
  • datafusion/physical-plan/src/aggregates/group_values

1 file changed

+29
-4
lines changed

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

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,32 @@ pub struct GroupValuesColumn {
9595
/// values: (hash, group_index)
9696
map: RawTable<(u64, usize)>,
9797

98+
/// The size of `map` in bytes
99+
map_size: usize,
100+
101+
/// Contexts useful for `vectorized compare` and `vectorized append`,
102+
/// detail can see [`GroupIndexContext`]
98103
group_index_ctxs: Vec<GroupIndexContext>,
99104

100-
/// Some
105+
/// We need multiple rounds to process the `input cols`,
106+
/// and the rows processing in current round is stored here.
107+
current_indices: Vec<usize>,
108+
109+
/// Similar as `current_indices`, but `remaining_indices`
110+
/// is used to store the rows will be processed in next round.
101111
remaining_indices: Vec<usize>,
102112

103-
/// The size of `map` in bytes
104-
map_size: usize,
113+
/// The `vectorized compared` row indices buffer
114+
vectorized_compare_row_indices: Vec<usize>,
115+
116+
/// The `vectorized compared` group indices buffer
117+
vectorized_compare_group_indices: Vec<usize>,
118+
119+
/// The `vectorized compared` result buffer
120+
vectorized_compare_results: Vec<bool>,
121+
122+
/// The `vectorized append` row indices buffer
123+
vectorized_append_row_indices: Vec<usize>,
105124

106125
/// The actual group by values, stored column-wise. Compare from
107126
/// the left to right, each column is stored as [`GroupColumn`].
@@ -138,7 +157,13 @@ impl GroupValuesColumn {
138157
hashes_buffer: Default::default(),
139158
random_state: Default::default(),
140159
column_nullables_buffer: vec![false; num_cols],
141-
append_rows_buffer: Vec::new(),
160+
append_rows_buffer: Default::default(),
161+
current_indices: Default::default(),
162+
remaining_indices: Default::default(),
163+
vectorized_compare_row_indices: Default::default(),
164+
vectorized_compare_group_indices: Default::default(),
165+
vectorized_compare_results: Default::default(),
166+
vectorized_append_row_indices: Default::default(),
142167
})
143168
}
144169

0 commit comments

Comments
 (0)