title: Cannot compile Spark Streaming example: getting updateStateByKey is not a member of org.apache.spark.streaming.dstream.DStream error
body: <p>I want to understand Spark Streaming better so i copied the StatefulNetworkWordCount.scala example in its own directory, and pasted it <em>as-is</em>, created a simple sbt config file, and tried to compile but it doesnt seem to work. Why is it complaining about the API?
  Any idea? The original example does compile fine, but i want to change it, without having to compile the <em>whole</em> spark directory like it is set up by default.</p>
  
  <p>thanks!
  Matt</p>
  
  <pre><code>$ more build.sbt
  name := "Simple Project"
  
  version := "1.0"
  
  scalaVersion := "2.10.4"
  
  libraryDependencies += "org.apache.spark" %% "spark-core" % "1.2.1"
  libraryDependencies += "org.apache.spark" % "spark-streaming_2.10" % "1.2.1"
  urbanlegends-2:streamingtest mlieber$ 
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>urbanlegends-2:streamingtest mlieber$sbt package
  [info] Set current project to Simple Project (in build file:/Users/mlieber/app/spark2/spark/examples/lieber/streamingtest/)
  [info] Compiling 2 Scala sources to /Users/mlieber/app/spark2/spark/examples/lieber/streamingtest/target/scala-2.10/classes...
  [error] /Users/mlieber/app/spark2/spark/examples/lieber/streamingtest/src/main/scala/com/cloudera/streamingtest/StatefulNetworkWordCount2.scala:58: value updateStateByKey is not a member of org.apache.spark.streaming.dstream.DStream[(String, Int)]
  [error]     **val stateDstream = wordDstream.updateStateByKey[Int](newUpdateFunc,
  [error]**                                    ^
  [error] one error found
  [error] (compile:compile) Compilation failed
  [error] Total time: 3 s, completed Mar 16, 2015 4:23:15 PM
  urbanlegends-2:streamingtest mlieber$ 
  </code></pre>