Exiting Spark shell from scala script

I use this command to run scala scripts.

spark-shell -i test.scala 

At the end of the script, I still see the launch of the spark shell.

I used ": q /: quit" in the test.scala script to try to exit, but it does not work.

+7
scala apache-spark
source share
1 answer

You need to add exit () to the end of your script to avoid going to scala REPL.

Heelloworld.scala

 print("Hello World"); print("Second Line"); print("Bye now"); exit() 

Run above

 spark-shell -i helloworld.scala 
+7
source share

All Articles