0

We are planning to using Scala on Spark to make computations. Just want to know what is the best way to execute Scala in Spark ; Scala as Script (or) Scala as Application. Is there any advantage/disadvantage between these 2 methods?

As mentioned here it is possible to execute Scala as Script. I am trying to skip the compilation process using sbt so that I can use Scala as script just like we will use Python

1 Answer 1

2

I suppose you mean by scala as script the scala REPL comes with spark (spark-shell) and scala application is the standlaone appliction packaged by sbt or maven.

  • Use scala shell (spark-shell) to test your algoriothm/implementation . So it should be used as staging phase.
  • When you have tested your implementation you should put it in a standalone application, package it and deliever a "fat jar" that could be submited by using spark-submit

Hope this is clear enough

Sign up to request clarification or add additional context in comments.

2 Comments

I have updated my question. I just want to skip the manual compilation process using sbt ; so that I can execute scala as script similar to Python
That is the same thing mentioned in my answer. Most of the time you use some dependencies in your application so you need to package them within your application to launch it on a cluster. for Scala scripts ,IMHO, could not be delivered in production environment

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.