map reduce to transform rating data to a compact form