title: map reduce problem, computation at values
body: <p>I am new to map reduce paradigm, and trying to find better solution for the below problem. </p>
  
  <p>I have a below set of rows - consisting google play store app reviews , the columns are AppName,Category,Type,rating, example row could be [Zomato,Food,Free,4.2],[Swiggy,Food,Paid,3.2] and so on
  Question, find the ratio between average paid and free ratings for each category?
  how can i solve this using map reduce paradigm / spark </p>
  
  <p>is it like in map side emit key and composite value as (Food, (Free,4.2)), (Food,(Paid,3.2))
  then do average computation at reduce side with list (values)? is there a better way?  </p>