title: reduceByKey method not being found in Scala Spark
body: <p>Attempting to run <a href="http://spark.apache.org/docs/latest/quick-start.html#a-standalone-app-in-scala" rel="nofollow noreferrer">http://spark.apache.org/docs/latest/quick-start.html#a-standalone-app-in-scala</a> from source.</p>
  
  <p>This line:</p>
  
  <pre class="lang-py prettyprint-override"><code>val wordCounts = textFile.flatMap(line =&gt; line.split(" ")).map(word =&gt; (word, 1)).reduceByKey((a, b) =&gt; a + b)
  </code></pre>
  
  <p>is throwing error </p>
  
  <pre><code>value reduceByKey is not a member of org.apache.spark.rdd.RDD[(String, Int)]
    val wordCounts = logData.flatMap(line =&gt; line.split(" ")).map(word =&gt; (word, 1)).reduceByKey((a, b) =&gt; a + b)
  </code></pre>
  
  <p><code>logData.flatMap(line =&gt; line.split(" ")).map(word =&gt; (word, 1))</code> returns a MappedRDD but I cannot find this type in <a href="http://spark.apache.org/docs/0.9.1/api/core/index.html#org.apache.spark.rdd.RDD" rel="nofollow noreferrer">http://spark.apache.org/docs/0.9.1/api/core/index.html#org.apache.spark.rdd.RDD</a> </p>
  
  <p>I'm running this code from Spark source so could be a classpath problem ? But required dependencies are on my classpath.</p>