mapreduce function

Reduce fields to userdefined mask