title: PySpark distinct().count() on a csv file
body: <p>I'm new to spark and I'm trying to make a distinct().count() based on some fields of a csv file.</p>
  
  <p>Csv structure(without header):</p>
  
  <pre><code>id,country,type
  01,AU,s1
  02,AU,s2
  03,GR,s2
  03,GR,s2
  </code></pre>
  
  <p>to load .csv I typed:</p>
  
  <pre><code>lines = sc.textFile("test.txt")
  </code></pre>
  
  <p>then a distinct count on <code>lines</code> returned 3 as expected:</p>
  
  <pre><code>lines.distinct().count()
  </code></pre>
  
  <p>But I have no idea how to make a distinct count based on lets say <code>id</code> and <code>country</code>. </p>