Skip to content

Reduction Mode Example

Amy Boyer edited this page Feb 4, 2019 · 31 revisions

This example is to clarify the difference between how default reduction and running reduction work. Imagine the extract from each classification produces a number from 0 to 10 and the reducer computes the average of these numbers.

The same extracts are processed by each reducer in the same order and we illustrate the changing values in the system as they arrive.

Default Reduction

Extract ID Extract Value Extracts to reducer Store Value In Operation Result Store Value Items in Association
1 5 1 nil 5/1 5 nil 0
2 3 1, 2 nil (5+3)/2 4 nil 0
3 4 1, 2, 3 nil (5+3+4)/3 4 nil 0

Running Reduction

Extract ID Extract Value Extracts to reducer Store Value In Operation Result Store Value Items in Association
1 5 1 nil 5/1 5 1 1
2 3 2 1 ((5*1)+3)/(1+1) 4 2 2
3 4 3 2 ((2*4)+4)/(2+1) 4 nil 0
Clone this wiki locally