You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To build a Spark application, you need Spark and its dependencies in a single Java archive (JAR) file. Create this JAR in Spark's main directory with sbt as:
~/spark$ sbt/sbt assembly
create a source file in ~/SparkTest/src/main/scala directory:
~/SparkTest/src/main/scala$ vi Test1.scala
Make the contain of the Test1.scala file like this:
import spark.SparkContext
import spark.SparkContext._
object Test1 {
def main(args: Array[String]) {
val sc = new SparkContext("local", "SparkTest")
println(sc.parallelize(1 to 10).reduce(_ + _))
System.exit(0)
}
}