Sample Spark project that may be compiled into a JAR for running via spark-submit.
- Spark 2.10.5
- SBT 0.13.9
Both of these dependencies are available via Homebrew.
brew tap homebrew/versions
brew install scala210
brew install sbtTo build a JAR for submission via spark-submit use the assembly SBT task.
sbt assemblyA custom task exists to both compile the JAR and submit it to the Spark cluster. It will need to be edited to point at your local spark-submit executable. This may be used within an IDE such as IntelliJ.
lazy val spark_run = taskKey[Unit]("Builds the assembly and ships it to the Spark Cluster")
spark_run := {
("/full/path/to/bin/spark_submit " + assembly.value) !
}