sortBy is not a member of org.apache.spark.rdd.RDD
<p>Hello~ I'm interested in SPARK.
I use this below code in spark-shell.</p>

<pre><code>val data = sc.parallelize(Array(Array(1,2,3), Array(2,3,4), Array(1,2,1))
res6: org.apache.spark.rdd.RDD[Array[Int]] = ParallelCollectionRDD[0] at parallelize at &lt;console&gt;:26

data.map(x =&gt; (x(d), 1)).reduceByKey((x,y) =&gt; x + y).sortBy(_._1)
res9: Array[(Int, Int)] = Array((1,2), (2,1))
</code></pre>

<p>It work. But, if I use this command using sbt assembly, It's not worked.</p>

<p>The error message is   </p>

<blockquote>
  <p>[error] value sortBy is not a member of org.apache.spark.rdd.RDD[(Int, Int)]</p>
  
  <p>[error]       data.map(x => (x(d), 1)).reduceByKey((x,y) => x + y).<strong>sortBy(_._1)</strong> &lt;= here is the problem.</p>
</blockquote>

<p>my build.sbt code is</p>

<pre><code>import AssemblyKeys._

assemblySettings

name := "buc"

version := "0.1"

scalaVersion := "2.10.5"

libraryDependencies += "org.apache.spark" % "spark-mllib_2.10" % "1.0.0" % "provided"
</code></pre>

<p>Is there something problem?</p>