You tell us, why you need the sort stage to store the data in the file. If your requirement is to find the max of the group, and that too, if you already found using the 2nd aggregator, I dont find a need to sort stage. If you give some example of what you expect, and what you get if sort stage is b...