I am using CDH 5.2. I am able to use spark-shell to run the commands.
- How can I run the file(file.spark) which contain spark commands.
- Is there any way to run/compile the scala programs in CDH 5.2 without sbt?
Thanks in advance
I am using CDH 5.2. I am able to use spark-shell to run the commands.
Thanks in advance
To load an external file from spark-shell simply do
This will call everything in your file.
I don't have a solution for your SBT question though sorry :-)
Just to give more perspective to the answers
Spark-shell is a scala repl
You can type :help to see the list of operation that are possible inside the scala shell
:load interpret lines in a file
You can use either sbt or maven to compile spark programs. Simply add the spark as dependency to maven
And then the dependency:
In terms of running a file with spark commands: you can simply do this:
Now run the commands script:
In command line, you can use
to run code which is written in
file.scala