Spark : how to run spark file from spark shell

Ramakrishna picture Ramakrishna · Dec 31, 2014 · Viewed 106.3k times · Source


I am using CDH 5.2. I am able to use spark-shell to run the commands.

  1. How can I run the file(file.spark) which contain spark commands.
  2. Is there any way to run/compile the scala programs in CDH 5.2 without sbt?

Thanks in advance

Answer

Ziyao  Li picture Ziyao Li · Mar 17, 2015

In command line, you can use

spark-shell -i file.scala

to run code which is written in file.scala