title: Scala -- how to create map from raw data to compute distinct values
body: <p>New to Scala and trying to read the input raw data to generate a map with groupBy on multiple fields.</p>
  
  <p>Sample raw data:</p>
  
  <pre><code>date,uid,site,success
  2014-07-14,userA,google,1
  2014-07-14,userB,google,1
  2014-07-14,userC,yahoo,1
  2014-07-14,userD,facebook,1
  </code></pre>
  
  <p>I want to report the number of distinct users per site for each date ie,</p>
  
  <pre><code>2014-07-14,google,2
  2014-07-14,yahoo,1
  2014-07-14,facebook,1
  </code></pre>
  
  <p>For this purpose, I'm trying to use groupBy on date and site fields with value as uid. Once I have this data structure, I can iterate over the map and compute the distinct map values.
  Can anyone point me to how to generate the data structure?</p>
  
  <p>Thanks!</p>