Commit e151786 1 parent ffa7d1a commit e151786 Copy full SHA for e151786
File tree 1 file changed +43
-0
lines changed
1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,49 @@ pub trait Accumulator: Send + Sync + Debug {
206
206
/// that each distinct group key appears in exactly one of the
207
207
/// `AggregateMode::Final` GroupBy nodes. The output of the final nodes are
208
208
/// then unioned together to produce the overall final output.
209
+ ///
210
+ /// Here is an example that shows the distribution of groups in the
211
+ /// different phases
212
+ ///
213
+ /// ```text
214
+ /// ┌─────┐ ┌─────┐
215
+ /// │ 1 │ │ 3 │
216
+ /// ├─────┤ ├─────┤
217
+ /// │ 2 │ │ 4 │ After repartitioning by
218
+ /// └─────┘ └─────┘ hash(group keys), each distinct
219
+ /// ┌─────┐ ┌─────┐ group key now appears in exactly
220
+ /// │ 1 │ │ 3 │ one partition
221
+ /// ├─────┤ ├─────┤
222
+ /// │ 2 │ │ 4 │
223
+ /// └─────┘ └─────┘
224
+ ///
225
+ ///
226
+ /// ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
227
+ ///
228
+ /// ┌─────┐ ┌─────┐
229
+ /// │ 2 │ │ 2 │
230
+ /// ├─────┤ ├─────┤
231
+ /// │ 1 │ │ 2 │
232
+ /// ├─────┤ ├─────┤
233
+ /// │ 3 │ │ 3 │
234
+ /// ├─────┤ ├─────┤
235
+ /// │ 4 │ │ 1 │
236
+ /// └─────┘ └─────┘ Input data is arbitrarily or
237
+ /// ... ... RoundRobin distributed, each
238
+ /// ┌─────┐ ┌─────┐ partition likely has all
239
+ /// │ 1 │ │ 4 │ distinct group keys
240
+ /// ├─────┤ ├─────┤
241
+ /// │ 4 │ │ 3 │
242
+ /// ├─────┤ ├─────┤
243
+ /// │ 1 │ │ 1 │
244
+ /// ├─────┤ ├─────┤
245
+ /// │ 4 │ │ 3 │
246
+ /// └─────┘ └─────┘
247
+ ///
248
+ /// group values group values
249
+ /// in partition 0 in partition 1
250
+ ///
251
+ /// ```
209
252
fn state ( & mut self ) -> Result < Vec < ScalarValue > > ;
210
253
211
254
/// Updates the accumulator's state from an `Array` containing one
You can’t perform that action at this time.
0 commit comments