title: calculate the numbers of occurrences in a csv file in scala spark-RDD
body: <p>suppose these are my CSV file:</p>
  
  <pre><code>11111;44444
  22222;55555
  11111;44444
  33333;99999
  11111;77777
  22222;99999
  </code></pre>
  
  <p>I want to have the number of occurrences in the first column with different values of the second column.
  Like this :</p>
  
  <pre><code>(11111,2)
  (22222,2)
  (33333,1)
  </code></pre>
  
  <p>i've tried:</p>
  
  <pre><code>object CountDestOcc {
    def main(args: Array[String]) {
      val conf = new SparkConf()
      .setAppName("Word Count")
      .setMaster("local")
  
      val sc = new SparkContext(conf)
  
      //loading text file into textFile object .(RDD)
      val textFile = sc.textFile(args(0))
  
     val appsdest = textFile.flatMap (line =&gt; line.split(" ")).map(p=&gt;(p,1)).reduceByKey(_+_).collect()
     appsdest.foreach(println)
     sc.stop()
  
    }
  </code></pre>
  
  <p>I get :</p>
  
  <pre><code>(22222;55555,1)
  (22222;99999,1)
  (11111;77777,1)
  (11111;44444,2)
  (33333;99999,1)
  </code></pre>
  
  <p>How I can only consolidate with the first key to having the expected result?</p>