title: MapReduce/Aggregate operations in SpringBatch
body: <p>Is it possible to do MapReduce style operations in SpringBatch?</p>
  
  <p>I have two steps in my batch job. The first step calculates average. The second step compares each value with average to determine another value.</p>
  
  <p>For example, Lets say i have a huge database of Student scores. The first step calculates average score in each course/exam. The second step compares individual scores with average to determine grade based on some simple rule:</p>
  
  <ol>
  <li>A if student scores above average</li>
  <li>B if student score is Average</li>
  <li>C if student scores below average</li>
  </ol>
  
  <p>Currently my first step is a Sql which selects average and writes it to a table. Second step is a Sql which joins average scores with individual scores and uses a Processor to implement the rule.</p>
  
  <p>There are similar aggregation functions like avg, min used a lot in Steps and I'd really prefer if this can be done in Processors keeping the Sqls as simple as possible. Is there any way to write a Processor which aggregates results across multiple rows based on a grouping criteria and then Writes Average/Min to the Output table once? </p>
  
  <p>This pattern repeats a lot and i'm not looking for a Single processor implementation using a Sql which fetches both average and individual scores.</p>