Hadoop MR code for analysis