Saturday, 5 November 2016

Creating your first spark application in scala

Hello all,
Follow the below steps to create your first spark application.
  1. download the Sample POM file for the sample spark Project with Maven. POM
  2. Create a Maven project in Scala IDE with the above POM file.
  3. Maven update the project. It will take few minutes to download the jars.
  4. Maven install the project and see if build is success.
  5. Right click on project and click on configure and change the nature to scala. Soon there will be a lot of errors on the problem view.
  6. To get rid of those errors go in property and click on Scala Compiler – tick Use Project Settings and then select Fixed Scala installation 2.10.5 if spark is build with 2.10.
  7. Now remove the scala libraries. right click on project -> configure build path -> libraries -> remove scala libraries.
  8. Now go on source tab and make sure /src/main/scala folder is added in there, so that it take source files from this folder.
  9. Now you can start using this project for spark project. You can add both Scala(/src/main/scala) and Java(/src/main/java) sources in the same project and run.

No comments:

Post a Comment